View Issue Details

IDProjectCategoryView StatusLast Update
0014480mantisbtplug-inspublic2024-06-09 11:09
Reportertomgibson Assigned Todregad  
Status closedResolutionno change required 
Product Version1.2.11 
Summary0014480: Requiring 'bugnote_api.php' in a plugin causes certain features to break

Attempting to 'require_once' the file 'bugnote_api.php' in a plugin breaks viewing of issues where there is a relationship to another issue. APPLICATION ERROR #1802 is seen when trying to view an issue with a relationship to another bug. I believe this is triggered on either line 523 or line 536 of the file relationship_api.php. I have also encountered an error trying to resolve a bug with such a plugin installed: 'Invalid custom field definition 0001304'. I traced this to line 1444 of custom_field_api.php. The common attribute I see between these two cases is they are shortly after accessing variables declared with the global keyword.

Steps To Reproduce

I have been able to reproduce the former error on a fresh installation of stock mantis 1.2.11, however when trying to reproduce the latter error I simply got the same error as in the former circumstance (#1802). There must be something specific to my setup that causes this not to occur and error 0001304 to occur instead when resolving a bug. To reproduce the first case:

1) Install stock mantis 1.2.11 on fresh db.
2) Create a project and add two bugs
3) Create a relationship between the bugs.
4) Load the attached SuperCow plugin (this code differs from the example only by the require_once statement at the top of the file).
5) Attempt to view one of the two related bugs
6) See error.

Additional Information

Occured on server running PHP 5.3.9 hosted on Windows Server 2003 R2.

TagsNo tags attached.
Attached Files (513 bytes)




2024-05-23 07:03

developer   ~0068947

It is not necessary to include any of the MantisBT core APIs within plugins, as they are executed as part of the core so all functions are readily available.