View Issue Details

IDProjectCategoryView StatusLast Update
0025953mantisbtplug-inspublic2019-08-25 12:36
Reporterdregad Assigned Todregad  
Status closedResolutionfixed 
Target Version2.22.0Fixed in Version2.22.0 
Summary0025953: Missing an API function to check if a plugin event has been declared

I need to make a plugin adapt itself to the presence of an event declared by another, optional plugin.

If said plugin is not installed, or is an older version, then MantisBT throws a warning when trying to hook the event (2400: Event "xxx" has not yet been declared).

This could be done manually by checking $g_event_cache for the event, but it would be more elegant if MantisBT core provided a function to abstract that.

TagsNo tags attached.


Related Changesets

MantisBT: master a7098970

2019-08-03 04:56


Details Diff
New event_is_declared() function

Note: use isset() instead of array_key_exists() as discussed in PR

Replace usage of isset( $g_event_cache[...] ) elsewhere in event API,
by calls to the new function.

Fixes 0025953
Affected Issues
mod - core/event_api.php Diff File