Patch #5714
closedRequest for controller_issues_bulk_edit_after_save hook
0%
Description
I suggest adding controller_issues_bulk_edit_after_save hook to Issues controller.
Issue controller has hooks:- controller_issues_new_before_save
- controller_issues_new_after_save
- controller_issues_edit_before_save
- controller_issues_edit_after_save
- controller_issues_bulk_edit_before_save
That is pairs - ..._before_save/..._after_save. All but the controller_issues_bulk_edit_before_save hook.
I need this hook to notify external tool about adding journal to database. So I also suggest adding '':journal => journal'' to:- controller_issues_bulk_edit_before_save
- controller_issues_bulk_edit_before_save
Thanks
Files
Related issues
Updated by Holger Just over 14 years ago
You could register your code to the default active record before_save
hook of the Journal and/or the Issue model. Also, the current journal is available as the @current_journal
instance variable in the controller.
Updated by Mischa The Evil over 14 years ago
- Category changed from Issues to Plugin API
- Assignee set to Eric Davis
Eric, hook-requests are to be assigned to you as I remember correctly... ;/
Updated by Andriy Lesyuk over 14 years ago
Holger Just wrote:
You could register your code to the default active record
before_save
hook of the Journal and/or the Issue model. Also, the current journal is available as the@current_journal
instance variable in the controller.
The before_save
hook is called before the Journal is created. That is if an external tool tries to get such Journal by ID it failes to find it...
Updated by Holger Just over 14 years ago
Then hook yourself into Journal.after_save
. You can filter for issue journals there. Be aware that the whole journal stuff is currently undergoing changes. So don't trust that you will only have journal entries of issues.
Also, the current journal of an issue can be retrieved using @issue.current_journal
.
Updated by Andriy Lesyuk over 14 years ago
Journal.after_save
is also called before the journal is actually added...
Updated by Holger Just over 14 years ago
Well, no.
Journal#save
is currently only called in Issue#create_journal
, which is called as an after_save hook of Issue
. Thus, once the journal is saved, its respective issue was already saved to the DB. Methods registered to the Journal#after_save
hook are only called once the Journal object was correctly saved to the database.
Depending on the transaction isolation level of your database, you will not see the journal entry from another transaction before the first one is actually committed though. This will only happen after the request was successfully completed.
Updated by Andriy Lesyuk about 14 years ago
- File controller_issues_bulk_edit_after_save.patch controller_issues_bulk_edit_after_save.patch added
Anyway my patch works... Without it I had troubles...
Redmine's code contains other hooks in pairs - [before|after]_save. So I believe it is logical to add controller_issues_bulk_edit_before_save. And it is very easy to add this hook - just by applying this path. Can I expect this to be done? Otherwise I will need to patch Redmine's code on every upgrade. Please...
Thanks
Updated by Eric Davis almost 14 years ago
- Assignee deleted (
Eric Davis)
I am stepping down from working on Redmine. If someone else is interesting in working on this issue, feel free to reassign it to them.
Eric Davis
Updated by Andriy Lesyuk over 13 years ago
- Status changed from New to Resolved
I don't need applying this patch any more... So do whatever you want with it.
Updated by Jan Niggemann (redmine.org team member) almost 12 years ago
Closing this, status is resolved since 400 days and more (issue was last updated more than 400 days ago)...
Updated by Jan Niggemann (redmine.org team member) almost 12 years ago
- Status changed from Resolved to Closed
Updated by Go MAEDA about 6 years ago
- Is duplicate of Patch #8757: Add hook for bulk edit post-save state added