Patch for giving controller_issues_edit_after_save api hook the correct context
|Assignee:||Jean-Philippe Lang||% Done:|
The API hooks "controller_issues_edit_before/after_save" are not given the correct context (i.e. the same context that "controller_issues_new_before/after_save" get.)
Expected behavior: "controller_issues_new_after_save" and "controller_issues_edit_after_save" should be given the same context.
Actual behavior: "controller_issues_edit_after_save"'s context lacks a controller, project, request, and hook_caller. Plugins must use crazy work-arounds to gain access to them.
Fix: Issue#save_issue_with_child_records has no particular need to be in the Issue model. Moving it to IssuesController allows for a simple fix with minimal impact.
This is my first Redmine patch, and I'm happy to submit it through github, svn, etc, but I've attached it here for comment.
#1 Updated by Jean-Philippe Lang almost 5 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Target version set to 2.4.0
- Resolution set to Fixed
You're right about this, patch committed in r12219.
Note that your patch broke a few tests with a
undefined local variable or method `project' error,
project had to be replaced with