agileware-jp / redmine_issue_templates

Redmine Issue Template. Pull requests, reporting issues, stars and sponsoring are always welcome!
https://www.redmine.org/plugins/redmine_issue_templates
GNU General Public License v2.0
65 stars 28 forks source link

Fix project bound global note template deletion #65

Closed mk2 closed 1 year ago

mk2 commented 1 year ago

The global comment template and project relation were set to dependent: :nullify, but since the schema does not allow null values, the deletion failed. Therefore, the relation was switched to use has_and_belongs_to_many, making it function like dependent: :destroy. During this process, it was necessary to change the name of the intermediate table, so a migration was created.


What happend: Deleting global comment templates results in an internal error

Reproduction steps:

  1. Create a global comment template (also check for available projects)
  2. Change the created comment template from enabled to disabled
  3. Delete the comment template

Result: An internal error occurs


This PR also includes the changes made in PRs #66, #67, #69, and #70. (They have all been reviewed in their respective PRs.)