View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0013179 | mantisbt | plug-ins | public | 2011-07-26 09:16 | 2014-02-01 17:42 |
| Reporter | sagrawal | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | new | Resolution | open | ||
| Product Version | 1.2.5 | ||||
| Summary | 0013179: A new event EVENT_COPY_BUG should be added for plugin to do some extra work | ||||
| Description | We needed to do something more when a bug is copied using feature 'Copy Bug'. | ||||
| Additional Information | We have created a patch for this (attached with the issue). It might be useful to other users in the community. | ||||
| Tags | patch | ||||
| Attached Files | bug_copy_event.patch (1,174 bytes)
diff -Naur mantisbt-1.2.5/core/bug_api.php mantisbt-1.2.5-patch/core/bug_api.php --- mantisbt-1.2.5/core/bug_api.php 2011-04-05 23:54:17.000000000 +0530 +++ mantisbt-1.2.5-patch/core/bug_api.php 2011-07-18 18:10:49.000000000 +0530 @@ -1068,6 +1068,9 @@ db_query_bound( $query, Array( $t_bug_history['user_id'], $t_new_bug_id, $t_bug_history['date_modified'], $t_bug_history['field_name'], $t_bug_history['old_value'], $t_bug_history['new_value'], $t_bug_history['type'] ) ); } } + + //Let plugins to process after bug is copied. + event_signal( 'EVENT_COPY_BUG', array( $t_bug_id, $t_new_bug_id ) ); return $t_new_bug_id; } diff -Naur mantisbt-1.2.5/core/events_inc.php mantisbt-1.2.5-patch/core/events_inc.php --- mantisbt-1.2.5/core/events_inc.php 2011-04-05 23:54:17.000000000 +0530 +++ mantisbt-1.2.5-patch/core/events_inc.php 2011-07-18 18:10:42.000000000 +0530 @@ -79,6 +79,9 @@ 'EVENT_REPORT_BUG_DATA' => EVENT_TYPE_CHAIN, 'EVENT_REPORT_BUG' => EVENT_TYPE_EXECUTE, + # Bug copy event + 'EVENT_COPY_BUG' => EVENT_TYPE_EXECUTE, + # Bug view events 'EVENT_VIEW_BUG_DETAILS' => EVENT_TYPE_EXECUTE, 'EVENT_VIEW_BUG_EXTRA' => EVENT_TYPE_EXECUTE, | ||||