Project

General

Profile

Actions

Defect #15044

closed

Patch for giving controller_issues_edit_after_save api hook the correct context

Added by Jordan Hollinger over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Plugin API
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

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.


Files

git.patch (3.25 KB) git.patch Jordan Hollinger, 2013-10-04 23:12
Actions

Also available in: Atom PDF