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

Internal error exception occurs when creating a note template for a project #15

Closed yui-har closed 2 years ago

yui-har commented 2 years ago

Summary

You can create without setting anything in the tracker when creating a note template for a project. I think it is wrong to be able to create a note template even though the tracker is required.

input-note-template

Therefore, when redrawing the note template after creation, an Internal error exception occurs in the following place.

internal-error

An Internal error exception occurs, but the note template has been created, so if you try to create a note template with the same template name in the same project, "Name has already been taken" error message will be displayed.

[1] pry(main)> NoteTemplate.all
  NoteTemplate Load (2.8ms)  SELECT "note_templates".* FROM "note_templates"
=> [#<NoteTemplate:0x00007f9a8dd44cf0
  id: 1,
  name: "test1",
  description: "test1",
  memo: "",
  project_id: 7,
  tracker_id: nil,
  author_id: 1,
  enabled: false,
  position: 1,
  created_at: Thu, 24 Mar 2022 02:39:05 UTC +00:00,
  updated_at: Thu, 24 Mar 2022 02:39:05 UTC +00:00,
  visibility: "open">]
duplicate-name-error

Environment

yui-har commented 2 years ago

@maimai77 @kyamada23 Thank you for reviewing and merging #16 and #17. If the problem is resolved, please close this issue.