プロジェクト

全般

プロフィール

Vote #74472

完了

Patch for giving controller_issues_edit_after_save api hook the correct context

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Plugin API_20
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
20
version_id:
70
issue_org_id:
15044
author_id:
87066
assigned_to_id:
1
comments:
1
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
73
ステータス-->[Closed]

説明

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.


journals

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 @@issue.project@.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリPlugin API_20 にセット
  • 対象バージョン2.4.0_70 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0