I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #2116

Error updating custom field that has template

Added by apan loco over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
15 Oct 2012
Due date:
08 Dec 2012
% Done:

100%

Redmine version:
2.1.2
External issue:

Description

I have added an Integer Custom Field for Issues with a simple Custom Field Template:

[da@home extended_fields$]$ cat app/views/custom_values/int/_testinteger.html.erb
Test: <%= custom_field.value.to_s %>

It works great to show it:

TestInteger:    Test: 2

But when I try to change it, I’m greeted with:

404
The page you were trying to access doesn't exist or has been removed.

And this is generated in the logs:

Started PUT "/redmine/issues/1" for ::1 at Mon Oct 15 15:56:23 +0200 2012
Processing by IssuesController#update as HTML
  Parameters: {"last_journal_id"=>"1", "attachments"=>{"1"=>{"description"=>""}}, "time_entry"=>{"comments"=>"", "activity_id"=>"", "hours"=>""}, "notes"=>"", "commit"=>"Submit", "authenticity_token"=>"ox+MjDtCs+lxJubqmS2khv2v7mMYmCEXGy/HaVapVX8=", "utf8"=>"✓", "issue"=>{"subject"=>"Bug1", "description"=>"", "priority_id"=>"2", "status_id"=>"1", "custom_field_values"=>{"1"=>"33"}, "due_date"=>"", "estimated_hours"=>"", "tracker_id"=>"1", "assigned_to_id"=>"", "parent_issue_id"=>"", "is_private"=>"0", "start_date"=>"2012-10-15 00:00:00", "lock_version"=>"1", "done_ratio"=>"0"}, "id"=>"1"}
  Current user: user (id=1)
  Rendered mailer/_issue.text.erb (7.4ms)
  Rendered mailer/issue_edit.text.erb within layouts/mailer (11.3ms)
Missing template, responding with 404
  Rendered common/error.html.erb within layouts/base (0.1ms)
Completed 404 Not Found in 291ms (Views: 16.6ms | ActiveRecord: 19.3ms)

If I remove the custom field template (_testinteger.html.erb) everything works again.

I am using these versions:

Environment:
  Redmine version                          2.1.2.stable
  Ruby version                             1.8.7 (i686-darwin9.2.1)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         MySQL
Redmine plugins:
  extended_fields                          0.2.0b

So what am I doing wrong? Why can’t I change the values for the custom fields when I have added custom field templates?

/apan


Related issues

Related to Extended Fields - Bug #2115: 2.1.2 Compatibility Closed 15 Oct 2012 08 Dec 2012

Associated revisions

Revision 72 (diff)
Added by Andriy Lesyuk over 9 years ago

Text templates fixes (#2115 and #2116)

History

#1 Updated by Andriy Lesyuk over 9 years ago

  • Status changed from New to Open
  • Assignee set to Andriy Lesyuk

Please try adding also app/views/custom_values/int/_testinteger.text.erb with the same content and tell me if it works.

#2 Updated by apan loco over 9 years ago

This indeed fixes the issue.

I have the same problem if I update a Custom Field that is of one of the new types, more specifically “Project”. So just to test I also tried putting a _project.text.erb besides _project.html.erb and that also worked.

#3 Updated by Andriy Lesyuk over 9 years ago

Yeah... You just confirmed my assumption: When you update Redmine sends email in text or html+text format. And there is no *.text.erb template for “templated” custom fields... So the workaround is to add such templates.

P.S. Will need some time to fix this issue (have also work on other projects). Please use the workaround currently.

#4 Updated by apan loco over 9 years ago

Thanks for looking into it and finding a workaround so quickly. Appreciate it!

#5 Updated by Andriy Lesyuk over 9 years ago

  • Status changed from Open to In Progress
  • Target version set to 0.2.1

#6 Updated by Andriy Lesyuk over 9 years ago

  • % Done changed from 0 to 100

Fix is in SVN... Try updating.

#7 Updated by Andriy Lesyuk over 9 years ago

  • Due date set to 08 Dec 2012
  • Status changed from In Progress to Closed

Also available in: Atom PDF

Terms of use | Privacy policy