View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0020577||mantisbt||plug-ins||public||2016-02-07 18:45||2021-01-05 18:59|
|Priority||normal||Severity||feature||Reproducibility||have not tried|
|Summary||0020577: Consistent use of EVENT_UPDATE_BUG_DATA|
Currently the event EVENT_UPDATE_BUG_DATA (chain) is only triggered from the bug_update page.
|Tags||No tags attached.|
Proposal sounds OK to me, but how do you propose to restrict use of bug_set_field(), more to the point, how to enforce such a restriction ?
I mean "restriction" as reviewing current use and change into BugData higher level operations whenever its appropiate. Enforcing is not possible, nor recommended...
So one point of discussion here is to delimit which changes should be treated "silently", and which one should trigger side events and notifications
See related issue in Source integration plugin https://github.com/mantisbt-plugins/source-integration/issues/189
I copy and answer here @vboctor comments on the PR966
I understand your proposal as having a dedicated class for each event
This expands the idea of a dedicated class, which would be populated with some/all of the Bugdata properties, in this example.
In a future where more object-mapping is used to manage all application entities, this may make sens, to have
If we are worried about potential changes in BugData class, then the right move is to clean up that class. This class
This may be out of scope. Currently plugins currently have access to all core functions, without restrictions.
If i understand correctly, that's how it's supposed to work. Maybe it has not been made clear enough in the documentation.
Ideally, and i have it planned for a later change, is to move some validation/changes into this workflow inside BugData.
All the stuff about managing callbacks inside the BugData class is to adapt the current core actions to this requeriment,
Currently, the non-obviusly-documented method to stop a update execution is to throw an error. This is an all-or-nothing approach
Your suggestion would mean that a true or false must be explicitly returned by each plugin, and the event manager then stops the
The update methods provide parameters for both the modified BugData object, and the previous unchanged object. This was existing
In a totally personal note: i really need this functionality as soos as posible. This has been in work since 1.3.0.
Answering some of the inlined comments:
Yes, i did. However, at the moment i've tried to keep it simple.
It's done somehow with other callbacks. For example: