Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi. I already have like 300 nodes with select list field that contains like 5 different keys and each node has one of them selected. I decided I need to add this Other feature, but it doesn't really work, because no matter what I enter to Other field it gives illegal value. Probably because of keys in the Allowed list. But again, I cannot remove keys from Allowed list, because it gives me message that they are in use. So I'm basically stuck.
Comment | File | Size | Author |
---|---|---|---|
#3 | cck_select_other-2334679-migrate-field-to-widget-settings-test-only.patch | 6.86 KB | mradcliffe |
Comments
Comment #1
mradcliffeYes, you are kind of stuck. The only thing I can think of is to modify the field_config table entry for the field manually to get rid of that. However that's not a simple task as it requires unserializing and reserializing from PHP.
Something like this:
Might be a feature in this: to remove old allowed values.
Comment #2
jenlamptonI'm running into the same problem as mentioned above. If we could set the "Select list options" to be the same as the "Allowed values" that might help. I noticed that after adding this widget to an existing field, the "Select list options" were set to only
other|Other
. Once those were updated I was able to save items with no trouble.Comment #3
mradcliffeI think that this would be doable by writing a custom migration (not a Migrate migration). I think a form that lists possible fields using widget, and then on submit, get the raw field settings, unserialize, change, and use drupal_write_record. Then add the options to the field widget and save that via the API.
This is a test only patch, which should hopefully fail in the right ways.