Closed (fixed)
Project:
Case Tracker Plus
Version:
6.x-2.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2010 at 03:24 UTC
Updated:
21 Jul 2011 at 12:40 UTC
Hi, I am using OA and the last CT Plus. I've tried to localize the Status values by changing the CCK field (modifying and adding new values), but now, when I add a new task I get errors like this one:
"Illegal choice Duplicate in field_ct_plus_status_value_many_to_one element."
Looking at sources I see:
'field_ct_plus_status_value_many_to_one' => array(
'operator' => 'or',
'value' => array(
'Open' => 'Open',
'Resolved' => 'Resolved',
'Deferred' => 'Deferred',
'Duplicate' => 'Duplicate',
),
Does it mean I can not localize the Status field? Or add more values, without changing the sources?
Comments
Comment #1
danepowell commentedThe first thing that we need to determine here is where the error is coming from. It looks like it's actually coming from Views, not from CCK- do you have any thoughts on that?
Some more info that might help: is the node still successfully created? What "sources" are you referring to (where you see
'field_ct_plus_status_value_many_to_one' => array(...)?Generally speaking, when overriding a Feature, it's best to do so through code hooks rather than through the GUI. This obviates the need to fork the feature code ("changing the sources" as you describe), and makes upgrading to newer version of the feature much easier.
In concrete terms, that means that the best way to achieve what you want is to write a small module that implements a hook that will modify the CCK values as you wish, but without making any actual changes to the ct-plus-task content type or the CT Plus feature. I'll try to find or write a small tutorial on how to accomplish this.
Comment #2
danepowell commentedHere we go- I think that you'll want to create a new module, named ct_plus_custom for instance. Then use hook_content_default_fields_alter(&$fields) like so:
This will print out the $fields variable, which will include the ct_plus_task-field_ct_plus_status field. You should be able to modify the allowed fields in this array to your heart's content :)
Of course this still might not explain the source of your error.
Comment #3
danepowell commentedI've also placed a section on the project page that describes and links to resources that might help you in the customization process.
Comment #4
carlos.macao commentedHi, thank you for your fast answer.
After I rolled back my changes, done in CCK fields on the original values (Open Resolved....Bug, Feature Request, General Task) the error disappeared.
I will implement your hook solution.
Comment #5
danepowell commentedComment #7
tazus commentedI am sorry, but I can't find the page that describe the customization for localized status/type and priority? Thanks.
Comment #8
danepowell commentedLook at the project page, specifically the link to the "guide to customizing atrium"