bap14 / redmine_category_tree

Module for Redmine to allow categories to be a tree instead of a single-list
18 stars 21 forks source link

500 error when changing category #11

Open lijealso opened 10 years ago

lijealso commented 10 years ago

I'm getting the error below, when chaging an issue's category. Had version 0.0.3 installed and upgraded to 0.0.4 but still getting the error. I'm using rednine version 2.4.2 stable

Started PUT "/issues/107" for ---- Processing by IssuesController#update as HTML Parameters: {"time_entry"=>{"comments"=>"", "activity_id"=>"", "hours"=>""}, "commit"=>"Submeter", "last_journal_id"=>"", "authenticity_token"=>"X7ecUy0wqDh7IYHyTVZwg+OBQIU0uInp/YNMxrwG5bE=", "utf8"=>"✓", "id"=>"107", "issue"=>{"start_date"=>"", "estimated_hours"=>"", "custom_field_values"=>{"6"=>"Desconhecido", "7"=>"0,0", "13"=>["Aberta", ""], "1"=>["16", ""], "17"=>"Não", "2"=>["Pessoal", ""], "3"=>"Desconhecido", "4"=>"Desconhecido", "5"=>"Desconhecido"}, "priority_id"=>"3", "parent_issue_id"=>"", "is_private"=>"1", "project_id"=>"1", "notes"=>"", "fixed_version_id"=>"", "lock_version"=>"0", "subject"=>"Teste", "assigned_to_id"=>"1", "done_ratio"=>"0", "tracker_id"=>"1", "category_id"=>"33", "due_date"=>"", "tag_list"=>"", "private_notes"=>"0", "description"=>"teste", "status_id"=>"1"}, "new_checklist"=>""} Current user: xxx (id=1) Rendered mailer/issue_edit.text.erb within layouts/mailer (207.9ms) Completed 500 Internal Server Error in 832.3ms

ActionView::Template::Error (undefined method render_issue_category_with_tree_inline' for #<#<Class:0x7fa75786ac08>:0x7fa7575441a0>): 1: <%= "(#{l(:field_private_notes)}) " if @journal.private_notes? -%><%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %> 2: 3: <% details_to_strings(@journal_details, true).each do |string| -%> 4: <%= string %> 5: <% end -%> 6: app/helpers/issues_helper.rb:306:inshow_detail' app/helpers/issues_helper.rb:276:in details_to_strings' app/helpers/issues_helper.rb:262:ineach' app/helpers/issues_helper.rb:262:in details_to_strings' app/views/mailer/issue_edit.text.erb:3:in_app_views_mailer_issue_edit_text_erb___1610571336_70178354365620' app/models/mailer.rb:410:in mail' app/models/mailer.rb:409:inmail' app/models/mailer.rb:422:in initialize' app/models/mailer.rb:445:inmethod_missing' app/models/mailer.rb:86:in deliver_issue_edit' app/models/issue.rb:826:ineach_notification' app/models/mailer.rb:85:in deliver_issue_edit' app/models/journal.rb:77:ineach_notification' app/models/journal.rb:75:in each_notification' app/models/mailer.rb:84:indeliver_issue_edit' app/models/journal.rb:54:in save' app/models/issue.rb:1511:increate_journal' app/models/issue.rb:165:in create_or_update' app/controllers/issues_controller.rb:470:insave_issue_with_child_records' app/controllers/issues_controller.rb:458:in save_issue_with_child_records' app/controllers/issues_controller.rb:184:inupdate'

ghost commented 10 years ago

I tried this in a clean install of 2.4.4 and the latest head from the master branch and changing an issue from category to category was no issue.

L0rD59 commented 7 years ago

Hi,

I have same issue with last 3.3-stable redmine and redmine_category_tree 0.0.7.

See bellow my stacktrace :

Started PATCH "/issues/11248" for 172.18.0.1 at 2016-11-04 12:53:45 +0000
Processing by IssuesController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"3FyBNx3BEjrSfnuAUJuvibY/GIkz++9UWhv+Geh1PZMnL11Pi0L3bBL0HtoX72tLRFmO5PrwukBvTiiro+7ZQg==", "form_update_triggered_by"=>"", "issue"=>{"is_private"=>"0", "project_id"=>"70", "tracker_id"=>"1", "subject"=>"Impossible d'envoyer des mails depuis le réseau administratif", "description"=>"M. Dartois nous signale que les postes clients du r&eacute;seau Administratif ne peuvent pas envoyer d&#39;emails.", "author_id"=>"11", "status_id"=>"9", "priority_id"=>"3", "assigned_to_id"=>"11", "category_id"=>"139", "parent_issue_id"=>"", "start_date"=>"2016-11-04", "due_date"=>"", "estimated_hours"=>"1.0", "custom_field_values"=>{"50"=>"Mineure", "17"=>"", "16"=>""}, "tag_list"=>"", "notes"=>"", "private_notes"=>"0", "lock_version"=>"4"}, "time_entry"=>{"hours"=>"", "activity_id"=>"9", "comments"=>"", "custom_field_values"=>{"19"=>""}}, "last_journal_id"=>"76685", "commit"=>"Soumettre", "id"=>"11248"}
  SQL (8.7ms)  UPDATE "tokens" SET "updated_on" = '2016-11-04 12:53:45.180980' WHERE "tokens"."user_id" = $1 AND "tokens"."value" = $2 AND "tokens"."action" = $3 AND (created_on > '2016-11-03 12:53:45.180692')  [["user_id", 1], ["value", "8fa4d24c8dc5092d9ac27247fa2e5eadff18e34a"], ["action", "session"]]
   (2.3ms)  SELECT MAX("settings"."updated_on") FROM "settings"
  User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."type" IN ('User', 'AnonymousUser') AND "users"."status" = $1 AND "users"."id" = $2 LIMIT 1  [["status", 1], ["id", 1]]
  Current user: admin (id=1)
  Issue Load (0.3ms)  SELECT  "issues".* FROM "issues" WHERE "issues"."id" = $1 LIMIT 1  [["id", 11248]]
  Project Load (0.3ms)  SELECT  "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT 1  [["id", 70]]
   (0.2ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 70]]
  TimeEntryActivity Load (0.3ms)  SELECT  "enumerations".* FROM "enumerations" WHERE "enumerations"."type" IN ('TimeEntryActivity') AND "enumerations"."is_default" = $1  ORDER BY "enumerations"."position" ASC LIMIT 1  [["is_default", "t"]]
  CustomField Load (1.7ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE (type = 'TimeEntryCustomField')  ORDER BY "custom_fields"."position" ASC
  Tracker Load (0.3ms)  SELECT  "trackers".* FROM "trackers" WHERE "trackers"."id" = $1 LIMIT 1  [["id", 1]]
  IssueCustomField Load (0.8ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE "custom_fields"."type" IN ('IssueCustomField') AND (is_for_all = 't' OR id IN (SELECT DISTINCT cfp.custom_field_id FROM custom_fields_projects cfp WHERE cfp.project_id = 70))  ORDER BY "custom_fields"."position" ASC
  IssueCustomField Load (0.3ms)  SELECT "custom_fields".* FROM "custom_fields" INNER JOIN "custom_fields_trackers" ON "custom_fields"."id" = "custom_fields_trackers"."custom_field_id" WHERE "custom_fields"."type" IN ('IssueCustomField') AND "custom_fields_trackers"."tracker_id" = $1  [["tracker_id", 1]]
  SQL (0.3ms)  SELECT "custom_values"."id" AS t0_r0, "custom_values"."customized_type" AS t0_r1, "custom_values"."customized_id" AS t0_r2, "custom_values"."custom_field_id" AS t0_r3, "custom_values"."value" AS t0_r4, "custom_fields"."id" AS t1_r0, "custom_fields"."type" AS t1_r1, "custom_fields"."name" AS t1_r2, "custom_fields"."field_format" AS t1_r3, "custom_fields"."possible_values" AS t1_r4, "custom_fields"."regexp" AS t1_r5, "custom_fields"."min_length" AS t1_r6, "custom_fields"."max_length" AS t1_r7, "custom_fields"."is_required" AS t1_r8, "custom_fields"."is_for_all" AS t1_r9, "custom_fields"."is_filter" AS t1_r10, "custom_fields"."position" AS t1_r11, "custom_fields"."searchable" AS t1_r12, "custom_fields"."default_value" AS t1_r13, "custom_fields"."editable" AS t1_r14, "custom_fields"."visible" AS t1_r15, "custom_fields"."multiple" AS t1_r16, "custom_fields"."format_store" AS t1_r17, "custom_fields"."description" AS t1_r18 FROM "custom_values" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."id" = "custom_values"."custom_field_id" WHERE "custom_values"."customized_id" = $1 AND "custom_values"."customized_type" = $2  ORDER BY custom_fields.position  [["customized_id", 11248], ["customized_type", "Issue"]]
  Role Load (0.3ms)  SELECT "roles".* FROM "roles"
  WorkflowPermission Load (0.3ms)  SELECT "workflows".* FROM "workflows" WHERE "workflows"."type" IN ('WorkflowPermission') AND "workflows"."tracker_id" = $1 AND "workflows"."old_status_id" = $2 AND "workflows"."role_id" IN (9, 12, 4, 8, 5, 3)  [["tracker_id", 1], ["old_status_id", 9]]
   (0.3ms)  SELECT "custom_fields"."id", role_id FROM "custom_fields" INNER JOIN "custom_fields_roles" ON "custom_fields_roles"."custom_field_id" = "custom_fields"."id" INNER JOIN "roles" ON "roles"."id" = "custom_fields_roles"."role_id" WHERE "custom_fields"."type" IN ('IssueCustomField') AND "custom_fields"."visible" = $1  [["visible", "f"]]
  Project Exists (0.5ms)  SELECT  1 AS one FROM "projects" WHERE ((projects.status = 1 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) OR projects.id = 70) AND (projects.id IN (SELECT DISTINCT project_id FROM projects_trackers)) AND "projects"."id" = $1 LIMIT 1  [["id", 70]]
  Tracker Exists (2.2ms)  SELECT  1 AS one FROM "trackers" INNER JOIN "projects_trackers" ON "trackers"."id" = "projects_trackers"."tracker_id" WHERE "projects_trackers"."project_id" = $1 AND "trackers"."id" = $2 LIMIT 1  [["project_id", 70], ["id", 1]]
  IssueStatus Load (0.2ms)  SELECT  "issue_statuses".* FROM "issue_statuses" WHERE "issue_statuses"."id" = $1 LIMIT 1  [["id", 9]]
   (0.2ms)  SELECT "users".id FROM "users" INNER JOIN "groups_users" ON "users"."id" = "groups_users"."group_id" WHERE "users"."type" IN ('Group', 'GroupBuiltin', 'GroupAnonymous', 'GroupNonMember') AND "groups_users"."user_id" = $1  [["user_id", 1]]
  CACHE (0.0ms)  SELECT "roles".* FROM "roles"
  User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."type" IN ('User', 'AnonymousUser') AND "users"."id" = $1 LIMIT 1  [["id", 11]]
  IssueStatus Load (0.5ms)  SELECT DISTINCT "issue_statuses".* FROM "issue_statuses" INNER JOIN "workflows" ON "workflows"."new_status_id" = "issue_statuses"."id" AND "workflows"."type" IN ('WorkflowTransition') WHERE "workflows"."old_status_id" = $1 AND "workflows"."tracker_id" = $2 AND "workflows"."role_id" IN (2, 11, 9, 14, 12, 1, 13, 4, 8, 5, 15, 3) AND (author = 'f' AND assignee = 'f')  [["old_status_id", 9], ["tracker_id", 1]]
  IssueRelation Load (0.1ms)  SELECT "issue_relations".* FROM "issue_relations" WHERE "issue_relations"."issue_to_id" = $1  [["issue_to_id", 11248]]
  Role Load (0.2ms)  SELECT "roles".* FROM "roles" WHERE "roles"."assignable" = $1  [["assignable", "t"]]
  Principal Load (1.1ms)  SELECT DISTINCT "users".* FROM "users" INNER JOIN "members" ON "members"."user_id" = "users"."id" INNER JOIN "member_roles" ON "member_roles"."member_id" = "members"."id" INNER JOIN "roles" ON "roles"."id" = "member_roles"."role_id" WHERE "users"."status" = $1 AND "members"."project_id" = $2 AND "users"."type" IN ('User', 'Group') AND "roles"."assignable" = 't' AND "roles"."id" IN (2, 11, 9, 1, 4, 8, 5, 15, 3)  ORDER BY users.type DESC, users.lastname, users.firstname, users.id  [["status", 1], ["project_id", 70]]
  Principal Load (1.6ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 11]]
  CACHE (0.0ms)  SELECT "roles".* FROM "roles"
  CACHE (0.0ms)  SELECT "workflows".* FROM "workflows" WHERE "workflows"."type" IN ('WorkflowPermission') AND "workflows"."tracker_id" = $1 AND "workflows"."old_status_id" = $2 AND "workflows"."role_id" IN (9, 12, 4, 8, 5, 3)  [["tracker_id", 1], ["old_status_id", 9]]
  CACHE (0.0ms)  SELECT "custom_fields"."id", role_id FROM "custom_fields" INNER JOIN "custom_fields_roles" ON "custom_fields_roles"."custom_field_id" = "custom_fields"."id" INNER JOIN "roles" ON "roles"."id" = "custom_fields_roles"."role_id" WHERE "custom_fields"."type" IN ('IssueCustomField') AND "custom_fields"."visible" = $1  [["visible", false]]
  CACHE (0.0ms)  SELECT "roles".* FROM "roles"
  CACHE (0.0ms)  SELECT "workflows".* FROM "workflows" WHERE "workflows"."type" IN ('WorkflowPermission') AND "workflows"."tracker_id" = $1 AND "workflows"."old_status_id" = $2 AND "workflows"."role_id" IN (9, 12, 4, 8, 5, 3)  [["tracker_id", 1], ["old_status_id", 9]]
  CACHE (0.0ms)  SELECT "custom_fields"."id", role_id FROM "custom_fields" INNER JOIN "custom_fields_roles" ON "custom_fields_roles"."custom_field_id" = "custom_fields"."id" INNER JOIN "roles" ON "roles"."id" = "custom_fields_roles"."role_id" WHERE "custom_fields"."type" IN ('IssueCustomField') AND "custom_fields"."visible" = $1  [["visible", false]]
  CACHE (0.0ms)  SELECT "users".id FROM "users" INNER JOIN "groups_users" ON "users"."id" = "groups_users"."group_id" WHERE "users"."type" IN ('Group', 'GroupBuiltin', 'GroupAnonymous', 'GroupNonMember') AND "groups_users"."user_id" = $1  [["user_id", 1]]
  CACHE (0.0ms)  SELECT "roles".* FROM "roles"
  CACHE (0.0ms)  SELECT DISTINCT "issue_statuses".* FROM "issue_statuses" INNER JOIN "workflows" ON "workflows"."new_status_id" = "issue_statuses"."id" AND "workflows"."type" IN ('WorkflowTransition') WHERE "workflows"."old_status_id" = $1 AND "workflows"."tracker_id" = $2 AND "workflows"."role_id" IN (2, 11, 9, 14, 12, 1, 13, 4, 8, 5, 15, 3) AND (author = 'f' AND assignee = 'f')  [["old_status_id", 9], ["tracker_id", 1]]
   (0.8ms)  BEGIN
  Issue Exists (17.0ms)  SELECT  1 AS one FROM "issues" WHERE "issues"."token" = $1 LIMIT 1  [["token", "yFC6OFPXXvtpEh_iAmrmQg"]]
===========>INFOG SI LA PROVIDENCE
  CustomField Load (0.4ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE (type = 'ProjectCustomField')  ORDER BY "custom_fields"."position" ASC
  SQL (2.4ms)  SELECT "custom_values"."id" AS t0_r0, "custom_values"."customized_type" AS t0_r1, "custom_values"."customized_id" AS t0_r2, "custom_values"."custom_field_id" AS t0_r3, "custom_values"."value" AS t0_r4, "custom_fields"."id" AS t1_r0, "custom_fields"."type" AS t1_r1, "custom_fields"."name" AS t1_r2, "custom_fields"."field_format" AS t1_r3, "custom_fields"."possible_values" AS t1_r4, "custom_fields"."regexp" AS t1_r5, "custom_fields"."min_length" AS t1_r6, "custom_fields"."max_length" AS t1_r7, "custom_fields"."is_required" AS t1_r8, "custom_fields"."is_for_all" AS t1_r9, "custom_fields"."is_filter" AS t1_r10, "custom_fields"."position" AS t1_r11, "custom_fields"."searchable" AS t1_r12, "custom_fields"."default_value" AS t1_r13, "custom_fields"."editable" AS t1_r14, "custom_fields"."visible" AS t1_r15, "custom_fields"."multiple" AS t1_r16, "custom_fields"."format_store" AS t1_r17, "custom_fields"."description" AS t1_r18 FROM "custom_values" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."id" = "custom_values"."custom_field_id" WHERE "custom_values"."customized_id" = $1 AND "custom_values"."customized_type" = $2  ORDER BY custom_fields.position  [["customized_id", 70], ["customized_type", "Project"]]
   (0.2ms)  SELECT "users".id FROM "users" INNER JOIN "watchers" ON "users"."id" = "watchers"."user_id" WHERE "users"."type" IN ('User', 'AnonymousUser') AND "watchers"."watchable_id" = $1 AND "watchers"."watchable_type" = $2  [["watchable_id", 11248], ["watchable_type", "Issue"]]
  User Load (0.2ms)  SELECT "users".* FROM "users" INNER JOIN "watchers" ON "users"."id" = "watchers"."user_id" WHERE "users"."type" IN ('User', 'AnonymousUser') AND "watchers"."watchable_id" = $1 AND "watchers"."watchable_type" = $2  [["watchable_id", 11248], ["watchable_type", "Issue"]]
  ActsAsTaggableOn::Tag Load (0.3ms)  SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = $1 AND "taggings"."taggable_type" = $2 AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)  [["taggable_id", 11248], ["taggable_type", "Issue"]]
  CACHE (0.0ms)  SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = $1 AND "taggings"."taggable_type" = $2 AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)  [["taggable_id", 11248], ["taggable_type", "Issue"]]
  ActsAsTaggableOn::Tag Load (0.9ms)              SELECT * FROM tags WHERE id NOT IN (
              SELECT DISTINCT tag_id FROM taggings
            )

  Setting Load (1.3ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "issue_done_ratio"]]
  CACHE (0.0ms)  SELECT "roles".* FROM "roles"
  CACHE (0.0ms)  SELECT "workflows".* FROM "workflows" WHERE "workflows"."type" IN ('WorkflowPermission') AND "workflows"."tracker_id" = $1 AND "workflows"."old_status_id" = $2 AND "workflows"."role_id" IN (9, 12, 4, 8, 5, 3)  [["tracker_id", 1], ["old_status_id", 9]]
  CACHE (0.0ms)  SELECT "custom_fields"."id", role_id FROM "custom_fields" INNER JOIN "custom_fields_roles" ON "custom_fields_roles"."custom_field_id" = "custom_fields"."id" INNER JOIN "roles" ON "roles"."id" = "custom_fields_roles"."role_id" WHERE "custom_fields"."type" IN ('IssueCustomField') AND "custom_fields"."visible" = $1  [["visible", false]]
  CACHE (0.0ms)  SELECT "roles".* FROM "roles"
  CACHE (0.0ms)  SELECT "workflows".* FROM "workflows" WHERE "workflows"."type" IN ('WorkflowPermission') AND "workflows"."tracker_id" = $1 AND "workflows"."old_status_id" = $2 AND "workflows"."role_id" IN (9, 12, 4, 8, 5, 3)  [["tracker_id", 1], ["old_status_id", 9]]
  CACHE (0.0ms)  SELECT "custom_fields"."id", role_id FROM "custom_fields" INNER JOIN "custom_fields_roles" ON "custom_fields_roles"."custom_field_id" = "custom_fields"."id" INNER JOIN "roles" ON "roles"."id" = "custom_fields_roles"."role_id" WHERE "custom_fields"."type" IN ('IssueCustomField') AND "custom_fields"."visible" = $1  [["visible", false]]
  CustomField Load (1.1ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE (type = 'UserCustomField')  ORDER BY "custom_fields"."position" ASC
  SQL (0.4ms)  SELECT "custom_values"."id" AS t0_r0, "custom_values"."customized_type" AS t0_r1, "custom_values"."customized_id" AS t0_r2, "custom_values"."custom_field_id" AS t0_r3, "custom_values"."value" AS t0_r4, "custom_fields"."id" AS t1_r0, "custom_fields"."type" AS t1_r1, "custom_fields"."name" AS t1_r2, "custom_fields"."field_format" AS t1_r3, "custom_fields"."possible_values" AS t1_r4, "custom_fields"."regexp" AS t1_r5, "custom_fields"."min_length" AS t1_r6, "custom_fields"."max_length" AS t1_r7, "custom_fields"."is_required" AS t1_r8, "custom_fields"."is_for_all" AS t1_r9, "custom_fields"."is_filter" AS t1_r10, "custom_fields"."position" AS t1_r11, "custom_fields"."searchable" AS t1_r12, "custom_fields"."default_value" AS t1_r13, "custom_fields"."editable" AS t1_r14, "custom_fields"."visible" AS t1_r15, "custom_fields"."multiple" AS t1_r16, "custom_fields"."format_store" AS t1_r17, "custom_fields"."description" AS t1_r18 FROM "custom_values" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."id" = "custom_values"."custom_field_id" WHERE "custom_values"."customized_id" = $1 AND "custom_values"."customized_type" = $2  ORDER BY custom_fields.position  [["customized_id", 11], ["customized_type", "Principal"]]
  SQL (4.1ms)  UPDATE "issues" SET "category_id" = 139, "token" = 'yFC6OFPXXvtpEh_iAmrmQg', "updated_on" = '2016-11-04 12:53:45.404010', "lock_version" = 5 WHERE "issues"."id" = $1 AND "issues"."lock_version" = $2  [["id", 11248], ["lock_version", 4]]
  SQL (1.2ms)  INSERT INTO "journals" ("journalized_id", "journalized_type", "user_id", "notes", "created_on") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["journalized_id", 11248], ["journalized_type", "Issue"], ["user_id", 1], ["notes", ""], ["created_on", "2016-11-04 12:53:45.431698"]]
  SQL (1.8ms)  INSERT INTO "journal_details" ("property", "prop_key", "value", "journal_id") VALUES ($1, $2, $3, $4) RETURNING "id"  [["property", "attr"], ["prop_key", "category_id"], ["value", "139"], ["journal_id", 76688]]
  SQL (0.2ms)  INSERT INTO "journal_details" ("property", "prop_key", "old_value", "value", "journal_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["property", "attr"], ["prop_key", "token"], ["old_value", "AMRvrBBv71I3OQxJCiZ36g"], ["value", "yFC6OFPXXvtpEh_iAmrmQg"], ["journal_id", 76688]]
  Setting Load (0.4ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "notified_events"]]
  SQL (0.2ms)  DELETE FROM "journal_details" WHERE "journal_details"."journal_id" = $1 AND "journal_details"."id" = 168348  [["journal_id", 76688]]
  Issue Load (0.3ms)  SELECT  "issues".* FROM "issues" WHERE "issues"."id" = $1 LIMIT 1  [["id", 11248]]
  Project Load (0.2ms)  SELECT  "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT 1  [["id", 70]]
  EnabledModule Load (0.1ms)  SELECT "enabled_modules".* FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 70]]
  Issue Load (0.3ms)  SELECT  "issues".* FROM "issues" WHERE "issues"."id" = $1 LIMIT 1  [["id", 11248]]
  Setting Load (0.3ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "default_language"]]
  Issue Load (0.2ms)  SELECT  "issues".* FROM "issues" WHERE "issues"."id" = $1 LIMIT 1  [["id", 11248]]
  Project Load (0.2ms)  SELECT  "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT 1  [["id", 70]]
  User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."type" IN ('User', 'AnonymousUser') AND "users"."id" = $1 LIMIT 1  [["id", 11]]
  Principal Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 11]]
  Tracker Load (0.2ms)  SELECT  "trackers".* FROM "trackers" WHERE "trackers"."id" = $1 LIMIT 1  [["id", 1]]
  Token Exists (0.7ms)  SELECT  1 AS one FROM "tokens" WHERE "tokens"."value" = '' LIMIT 1
  Token Exists (1.3ms)  SELECT  1 AS one FROM "tokens" WHERE "tokens"."value" = '' LIMIT 1
  SQL (0.2ms)  DELETE FROM "tokens" WHERE "tokens"."user_id" = $1 AND "tokens"."action" = $2  [["user_id", 11], ["action", "autologin_by_token"]]
  SQL (0.6ms)  INSERT INTO "tokens" ("user_id", "action", "created_on", "updated_on", "value") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["user_id", 11], ["action", "autologin_by_token"], ["created_on", "2016-11-04 12:53:45.476027"], ["updated_on", "2016-11-04 12:53:45.476027"], ["value", "fc192d883a65eee0c5aaa4811e229f031aab89b9"]]
  Setting Load (0.3ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "protocol"]]
  Setting Load (0.3ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "host_name"]]
  EmailAddress Load (0.2ms)  SELECT  "email_addresses".* FROM "email_addresses" WHERE "email_addresses"."user_id" = $1 AND "email_addresses"."is_default" = $2 LIMIT 1  [["user_id", 11], ["is_default", "t"]]
  Setting Load (0.2ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "mail_from"]]
  UserPreference Load (0.4ms)  SELECT  "user_preferences".* FROM "user_preferences" WHERE "user_preferences"."user_id" = $1 LIMIT 1  [["user_id", 1]]
  Setting Load (0.3ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = $1  ORDER BY "settings"."id" DESC LIMIT 1  [["name", "bcc_recipients"]]
  IssueCategory Load (0.2ms)  SELECT  "issue_categories".* FROM "issue_categories" WHERE "issue_categories"."id" = $1 LIMIT 1  [["id", 139]]
  Rendered plugins/aw_issue_closure_reminder/app/views/mailer/closure_reminder.text.erb within layouts/mailer (244.9ms)

Mailer#closure_reminder: processed outbound mail in 294.0ms
   (0.3ms)  ROLLBACK
Completed 500 Internal Server Error in 578ms (ActiveRecord: 63.9ms)

ActionView::Template::Error (undefined method `render_issue_category_with_tree_inline' for #<#<Class:0x00560860ebf320>:0x00560860e41420>):
    1: <%= "(#{l(:field_private_notes)}) " if @journal.private_notes? -%><%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %>
    2: 
    3: <% details_to_strings(@journal.details, true).each do |string| -%>
    4: <%= string %>
    5: <% end -%>
    6: 
  plugins/redmine_category_tree/lib/redmine_category_tree/patches/issues_helper_patch.rb:30:in `find_name_by_reflection_with_issue_categories'
  app/helpers/issues_helper.rb:391:in `show_detail'
  plugins/redmine_change_issue_author/lib/issues_helper_patch.rb:24:in `show_detail_with_author'
  app/helpers/issues_helper.rb:355:in `block in details_to_strings'
  app/helpers/issues_helper.rb:341:in `details_to_strings'
  plugins/aw_issue_closure_reminder/app/views/mailer/closure_reminder.text.erb:3:in `_plugins_aw_issue_closure_reminder_app_views_mailer_closure_reminder_text_erb__3377318162761613781_47296992236000'
  app/models/mailer.rb:482:in `block in mail'
  app/models/mailer.rb:481:in `mail'
  plugins/aw_issue_closure_reminder/lib/aw_issue_closure_reminder/patches/mailer_patch.rb:83:in `closure_reminder'
  app/models/mailer.rb:494:in `initialize'
  config/initializers/10-patches.rb:163:in `deliver'
  plugins/aw_issue_closure_reminder/lib/aw_issue_closure_reminder/patches/journal_patch.rb:37:in `send_notification_with_patch'
  app/models/journal.rb:67:in `save'
  app/models/issue.rb:1690:in `create_journal'
  app/models/issue.rb:210:in `create_or_update'
  app/controllers/issues_controller.rb:515:in `block in save_issue_with_child_records'
  app/controllers/issues_controller.rb:503:in `save_issue_with_child_records'
  app/controllers/issues_controller.rb:179:in `update'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

  Rendered /usr/local/bundle/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (7.6ms)
  Rendered /usr/local/bundle/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.5ms)
  Rendered /usr/local/bundle/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (2.9ms)
  Rendered /usr/local/bundle/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (28.1ms)

However the method render_issue_category_with_tree_inline exist in app/views/helpers/redmine_category_tree file.

Thx a lot for your help

namezero111111 commented 6 years ago

The problem is with event_notifications, or some other mailer action that patches the view or something and then the helper method is not found. Ruby is too counter intuitive for me, but I monkeypatched this in issues_helper_patch by copying the code from render_issue_category_with_tree_inline into the function. If you change find_name_by_reflection_with_issue_categories to:

def find_name_by_reflection_with_issue_categories(field, id)
          unless id.present?
            return nil
          end
          if field == 'category'
            association = Issue.reflect_on_association(field.to_sym)
            if association
              record = association.class_name.constantize.find_by_id(id)
              if record
                #return render_issue_category_with_tree_inline(record)
                category = record
   #def render_issue_category_with_tree_inline(category)
      s = ''
      if category.nil?
        return ''
      end
      ancestors = category.root? ? [] : category.ancestors.all
      if ancestors.any?
        ancestors.each do |ancestor|
          s << content_tag('span', h(ancestor.name), :class => 'parent')
        end
      end

      s << content_tag('span', h(category.name), :class => 'issue_category')

      if ancestors.any?
        s = content_tag('span', s, { :class => 'issue_category_tree' }, false)
      end
      return s.html_safe
   #end
              end
                      else
                          return find_name_by_reflection_without_issue_categories(field, id)
                      end
                  else
                    return find_name_by_reflection_without_issue_categories(field, id)
                  end
                end
            end
        end

Then it should work