View Issue Details

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

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.

Activities

Related Changesets

MantisBT: master a7098970

2019-08-03 08:56:37

dregad

Details Diff
New event_is_declared() function

Note: use isset() instead of array_key_exists() as discussed in PR
https://github.com/mantisbt/mantisbt/pull/1534#discussion_r310346891

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

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

Issue History

Date Modified Username Field Change
2019-08-02 14:17 dregad New Issue
2019-08-02 14:17 dregad Status new => assigned
2019-08-02 14:17 dregad Assigned To => dregad
2019-08-02 14:20 dregad Note Added: 0062492
2019-08-04 19:17 dregad Changeset attached => MantisBT master a7098970
2019-08-04 19:17 dregad Status assigned => resolved
2019-08-04 19:17 dregad Resolution open => fixed
2019-08-04 19:17 dregad Fixed in Version => 2.22.0
2019-08-25 12:36 vboctor Status resolved => closed