Project

General

Profile

Actions

Defect #39768

closed

Call to the `controller_issues_new_after_save` hook are not protected again plugin exceptions

Added by Stephen Gaito 6 months ago. Updated 6 months ago.

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

0%

Estimated time:
Resolution:
Wont fix
Affected version:

Description

The call to the `controller_issues_new_after_save` hook in the file `app/controllers/issues_controller.rb` (around line 153), does not protect against exceptions raised in the body of the hook.

This leads to the subsequent Redmine code not being run (including a page redirect) whenever new issues are created using plugins which do not themselves protect against exceptions in their code being raised.

Can the call to this hook be wrapped in a begin/rescue block?

(Many thanks for an excellent project!)

----
For the record here are my installation details:
Note that in this case the offending plugin is `redmine_issue_checklist` which has been patched in

- [fix controller_issues_new_after_save hook stale record exception ยท stephengaito/redmine_issue_checklist@565e8df](https://github.com/stephengaito/redmine_issue_checklist/commit/565e8dfb432309a8534a03c8cbe7477660e17f6e)

----

Environment:
  Redmine version                5.1.1.stable
  Ruby version                   3.2.2-p53 (2023-03-30) [aarch64-linux]
  Rails version                  6.1.7.6
  Environment                    production
  Database adapter               SQLite
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Alternate
SCM:
  Subversion                     1.14.2
  Mercurial                      6.3.2
  Bazaar                         3.3.2
  Git                            2.39.2
  Filesystem                     
Redmine plugins:
  additional_tags                3.1.0
  additionals                    3.1.0
  katex                          0.0.1
  redmine_issue_checklist        2.1.0
  redmine_mermaid_macro          1.1.0
  redmine_recurring_tasks        0.3.4

----

Actions

Also available in: Atom PDF