View Issue Details

IDProjectCategoryView StatusLast Update
0014329mantisbtplug-inspublic2014-09-23 18:05
Reportervincent_sels Assigned Todregad  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.2.8 
Target Version1.2.12Fixed in Version1.2.12 
Summary0014329: Updating bug status should provide event to display mandatory plug-in fields
Description

When updating the bug status (bug_change_status_page.php), mandatory custom fields are displayed so they can be filled in at that time. However, when a plugin introduces mandatory fields, there is currently no way to initialize these when the user uses the 'change status' option.

In order for a plug-in to achieve this, a new 'type_execute' event should be added to this page, so the plug-in can display its mandatory fields.

Your opinions ?

TagsNo tags attached.

Relationships

duplicate of 0010126 closeddaryn Add a plug-in event to bug_change_status_page.php 
related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

vincent_sels

vincent_sels

2012-05-30 06:06

reporter   ~0031924

Product version is 1.2.8, sorry, forgot to include.

If you want I could provide a pull request for this fix. Pretty straightforward: add the following line in events_inc.php:

# Bug update events
'EVENT_UPDATE_BUG_FORM_TOP' => EVENT_TYPE_EXECUTE,
'EVENT_UPDATE_BUG_FORM' => EVENT_TYPE_EXECUTE,
'EVENT_UPDATE_BUG' => EVENT_TYPE_CHAIN,
<b>'EVENT_BUG_STATUS_UPDATE_FORM' => EVENT_TYPE_EXECUTE,</b>

and add this event to the bug_change_status_page.php:

<?php

<b>event_signal( 'EVENT_BUG_STATUS_UPDATE_FORM', array( $f_bug_id ) );</b>

if ( ON == $f_reopen_flag ) {
    # bug was re-opened
    printf("    <input type=\"hidden\" name=\"resolution\" value=\"%s\" />\n",  config_get( 'bug_reopen_resolution' ) );
}

?>

dregad

dregad

2012-05-31 06:16

developer   ~0031934

Sounds reasonable to me, but I'm no expert on plugins so you might want to get jreese's opinion on; try IRC #mantisbt or the mailing list, you'll have more chance to reach him.

jreese

jreese

2012-07-12 14:23

reporter   ~0032316

Seems like a useful usecase. My only concern would be that the event name isn't consistent with the existing events. I would suggest EVENT_UPDATE_BUG_STATUS_FORM instead.

vincent_sels

vincent_sels

2012-07-12 16:16

reporter   ~0032317

Suggested fix in pull request https://github.com/mantisbt/mantisbt/pull/54

vincent_sels

vincent_sels

2012-07-12 16:58

reporter   ~0032318

Somehow the diff didn't work. Retried, looks better: https://github.com/mantisbt/mantisbt/pull/55

dregad

dregad

2012-08-07 04:11

developer   ~0032480

As discussed in the pull request [1], this is actually the same as 0010126 which has already been fixed in the master branch.

I will backport that commit to 1.2.x branch, and rename the event according to jreese's recommendation (0014329:0032316).

[1] https://github.com/mantisbt/mantisbt/pull/55#issuecomment-7440654

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036164

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x aecee48e

2010-08-13 04:23

dwarrine


Details Diff
Add event to allow plugins access to the bug change status form

This is a back-port of 5409ebc4e69bed8f8fa55129703d0d74e24f6a2f.

Fixes 0010126, 0014329

Conflicts:

core/events_inc.php
docbook/developers/en/event-reference-bug.sgml

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
Affected Issues
0010126, 0014329
mod - bug_change_status_page.php Diff File
mod - core/events_inc.php Diff File
mod - docbook/developers/en/event-reference-bug.sgml Diff File

MantisBT: master-1.2.x 9db97b99

2012-08-06 20:51

dregad


Details Diff
Renaming EVENT_BUG_CHANGE_STATUS_FORM to EVENT_UPDATE_BUG_STATUS_FORM

This is per jreese's recommendation, for consistency with existing
events names.

Fixes 0014329, see also 0010126
Affected Issues
0014329
mod - bug_change_status_page.php Diff File
mod - core/events_inc.php Diff File
mod - docbook/developers/en/event-reference-bug.sgml Diff File

MantisBT: master 6bbaa7b9

2012-08-06 20:51

dregad


Details Diff
Renaming EVENT_BUG_CHANGE_STATUS_FORM to EVENT_UPDATE_BUG_STATUS_FORM

This is per jreese's recommendation, for consistency with existing
events names.

Fixes 0014329, see also 0010126
Affected Issues
0014329
mod - bug_change_status_page.php Diff File
mod - core/events_inc.php Diff File
mod - docbook/Developers_Guide/en-US/Events_Reference_Bug.xml Diff File