Project

General

Profile

Actions

Defect #7377

closed

Updating an Issue with custom fields set fails in V.1.1.0

Added by Siegfried Vogel about 13 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
-
Start date:
2011-01-19
Due date:
% Done:

0%

Estimated time:
Resolution:
Cant reproduce
Affected version:

Description

The fix mentioned in related Ticket: #6403
is not working for me. (Redmine V.1.1.0)

When I enter into the console:

issue = Issue.find(1)
issue.custom_field_values[1] = dummy_value
issue.save!

I get this error:

NoMethodError: undefined method `save' for nil:NilClass
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `to_proc'
   from /usr/share/redmine/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb:94:in `each'
   from /usr/share/redmine/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb:94:in `save_custom_field_values'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
   from /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in `callback'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/callbacks.rb:251:in `create_or_update'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/base.rb:2555:in `save_without_validation!'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/validations.rb:1088:in `save_without_dirty!'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
   from /usr/share/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
   from (irb):8>> /usr/share/redmine/vendor/rails/activesupport/lib/active_support/callbacks.rb

Related issues

Related to Redmine - Defect #6403: Updating an issue with custom fields failsClosedJean-Philippe Lang2010-09-15

Actions
Actions #1

Updated by Siegfried Vogel about 13 years ago

I'm stuck. Is there some sample code showing how I am supposed to add a new Issue with some custom fields in a Redmine plugin?

Thanks a lot for your help!

Actions #2

Updated by Stefan Langenmaier about 13 years ago

You need to save the custom fields with an extra command before you can save the issue.

issue.save_custom_field_values

And double check that you have set all custom values that are required!

Actions #3

Updated by Toshi MARUYAMA almost 13 years ago

  • Category set to Custom fields
Actions #4

Updated by Go MAEDA about 7 years ago

  • Status changed from New to Closed
  • Resolution set to Cant reproduce

Redmine 1.1.0 is very old and no longer supported.
Please create a new issue if the problem persists in the latest version of Redmine.

Actions

Also available in: Atom PDF