View Issue Details

IDProjectCategoryView StatusLast Update
0012620mantisbtplug-inspublic2014-12-08 00:33
ReportersveyretAssigned Todhx 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.3 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0012620: Plug-ins included through function
Description

Plug-ins are included by core.php through functions in plugin_api.php.
This can cause problems if the plug-in itself requires an api defining global variables. The variable will not have global scope unless defined explicitly.

This can cause hard-to-debug errors.

If there is no other way, I think we should explicitly define global variables, even if they seem to be by default defined outside any scope (example, adding a
global $g_custom_field_type_definition;
in custom_field_api, even if it seems that this variable should be at a global scope).

Steps To Reproduce
  1. Create a project with a custom field.
  2. Create and install a plug-in with a require_once "bug_api.php" at the top of the main file.
  3. Report a new issue.
    You should get a:
    APPLICATION ERROR 0001304 (ERROR_CUSTOM_FIELD_INVALID_DEFINITION)
Additional Information

Including bug_api indirectly includes the cfdefs files for custom field definitions, which should be stored in a global variable. But as this include is made through the main file of plug-in, itself included through a function, the variable will actually not have this global scope.

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

grangeway

grangeway

2012-03-04 10:12

reporter   ~0031377

This is fixed in our development branches - as we moved to using a 'require_api' function instead of require_once - and that tries to handle the global scope

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036311

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Issue History

Date Modified Username Field Change
2010-12-20 08:00 sveyret New Issue
2010-12-20 14:33 jreese Status new => acknowledged
2010-12-20 14:33 jreese Target Version => 1.2.5
2011-04-05 12:25 jreese Target Version 1.2.5 => 1.2.6
2011-07-26 09:53 jreese Target Version 1.2.6 => 1.2.7
2011-08-22 10:49 jreese Target Version 1.2.7 => 1.2.8
2011-09-06 10:33 jreese Target Version 1.2.8 => 1.2.9
2012-03-04 09:23 atrol Target Version 1.2.9 => 1.2.10
2012-03-04 10:12 grangeway Note Added: 0031377
2012-03-04 10:12 grangeway Status acknowledged => resolved
2012-03-04 10:12 grangeway Fixed in Version => 1.3.0-beta.1
2012-03-04 10:12 grangeway Resolution open => no change required
2012-03-04 10:12 grangeway Assigned To => grangeway
2012-03-04 15:30 atrol Target Version 1.2.10 => 1.3.0-beta.1
2013-04-05 17:57 grangeway Status resolved => acknowledged
2013-04-05 17:57 grangeway Note Added: 0036311
2013-04-05 18:24 grangeway Relationship added related to 0015721
2013-04-06 03:44 dregad Status acknowledged => resolved
2013-04-06 07:20 grangeway Status resolved => acknowledged
2013-04-06 09:26 dregad Tag Attached: 2.0.x check
2013-04-06 09:26 dregad Status acknowledged => resolved
2013-04-27 16:52 atrol Tag Attached: 2.0.x fixed
2013-04-27 16:52 atrol Assigned To grangeway =>
2013-04-27 16:52 atrol Resolution no change required => open
2013-04-27 16:52 atrol Fixed in Version 1.3.0-beta.1 =>
2013-04-27 16:53 atrol Status resolved => acknowledged
2014-02-01 15:17 atrol Status acknowledged => resolved
2014-02-01 15:17 atrol Fixed in Version => 1.3.0-beta.1
2014-02-01 15:17 atrol Resolution open => fixed
2014-02-01 15:17 atrol Assigned To => dhx
2014-09-23 18:05 grangeway Tag Detached: 2.0.x check
2014-09-23 18:06 grangeway Tag Detached: 2.0.x fixed
2014-12-08 00:33 vboctor Status resolved => closed