MantisBT: master 8815b9d0

Author Committer Branch Timestamp Parent
dhx dhx master 2010-01-15 05:04 master 0995c231
Affected Issues  0011375: Users that are monitoring a bug should be transferred if the bug is closed as a duplicate
Changeset

Fix 0011375: Copy list of users monitoring duplicate bug to original bug

If a bug X is resolved as being a duplicate of bug Y, any users that are
monitoring bug X should automatically start monitoring bug Y (if they
aren't already).

This solution isn't perfect because it's still possible to manually add
a "duplicate" relationship within the relationship table or use
bug_update_page.php to manually resolve an issue as being a duplicate.

This copying of the bug monitor list thus only occurs when
bug_resolve(...) is called - ie. when a bug is resolved using the bug
status dropdown and a duplicate bug ID is provided on the following
bug_change_status_page.php page.

A new bug_monitor_copy( source_bug_id, destination_bug_id ) function has
been placed into bug_api.php for use in other cases too. Currently the
only other use of this function is when copying/cloning a bug.

One may wonder why a call to bug_monitor_copy() isn't made somewhere
within relationship_api.php to catch all cases where a duplicate
relationship is created. The reason is to do with maintaining low
coupling - relationship API shouldn't need to know about the logic of
duplicate bugs and bug monitoring lists.

Thanks to Akemi Yagi for reporting this issue on the CentOS bug tracker
at http://bugs.centos.org/view.php?id=3931 and to Mark Rappoport for
passing the matter upstream to MantisBT, providing an initial patch in
the process.

mod - core/bug_api.php Diff File