Content
View differences
Updated by Markus Kahl about 10 years ago
Updating a work package with a custom field with the list format may cause an error in some instances. See the stacktrace below.
The problem is that `custom_field.possible_values` returns nil. I’m not sure how it can happen but it does.
Specifically it happens on internal.openproject.com when trying to update work packages (e.g. \#7894) with the custom field “in Buchhaltung”. \[1\]
I’ve tried reproducing it by creating a new work package with that custom field specifically but I had no luck so far.
\[1\] https://internal.openproject.com/custom\_fields/17/edit
NoMethodError: undefined method `include?' for nil:NilClass
/usr/src/app/app/models/custom_value/
list_strategy.rb: 38:in `validate_type_of_value'
/usr/src/app/app/models/
custom_value.rb: 95:in `validate_type_of_value'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 399:in `run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `block in run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `run_validations!'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 338:in `valid?'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 375:in `invalid?'
…ugins/acts_as_customizable/lib/
acts_as_customizable.rb: 127:in `select'
…ugins/acts_as_customizable/lib/
acts_as_customizable.rb: 127:in `validate_custom_values'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 399:in `run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `block in run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `run_validations!'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 338:in `valid?'
/usr/src/app/app/models/work_package/
validations.rb: 85:in `valid?'
/usr/src/app/lib/api/contracts/
model_contract.rb: 73:in `validate'
…b/api/v3/work_packages/
work_packages_shared_helpers.rb: 61:in `create_work_package_form'
…sr/src/app/lib/api/v3/work_packages/
update_form_api.rb: 39:in `block (2 levels) in <class:UpdateFormAPI>'
The problem is that `custom_field.possible_values` returns nil. I’m not sure how it can happen but it does.
Specifically it happens on internal.openproject.com when trying to update work packages (e.g. \#7894) with the custom field “in Buchhaltung”. \[1\]
I’ve tried reproducing it by creating a new work package with that custom field specifically but I had no luck so far.
\[1\] https://internal.openproject.com/custom\_fields/17/edit
NoMethodError: undefined method `include?' for nil:NilClass
/usr/src/app/app/models/custom_value/
list_strategy.rb: 38:in `validate_type_of_value'
/usr/src/app/app/models/
custom_value.rb: 95:in `validate_type_of_value'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 399:in `run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `block in run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `run_validations!'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 338:in `valid?'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 375:in `invalid?'
…ugins/acts_as_customizable/lib/
acts_as_customizable.rb: 127:in `select'
…ugins/acts_as_customizable/lib/
acts_as_customizable.rb: 127:in `validate_custom_values'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 399:in `run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `block in run_validations!'
…odel-4.2.5.2/lib/active_model/validations/
callbacks.rb: 113:in `run_validations!'
…ms/activemodel-4.2.5.2/lib/active_model/
validations.rb: 338:in `valid?'
/usr/src/app/app/models/work_package/
validations.rb: 85:in `valid?'
/usr/src/app/lib/api/contracts/
model_contract.rb: 73:in `validate'
…b/api/v3/work_packages/
work_packages_shared_helpers.rb: 61:in `create_work_package_form'
…sr/src/app/lib/api/v3/work_packages/
update_form_api.rb: 39:in `block (2 levels) in <class:UpdateFormAPI>'