Hi guys,
I've been tasked to update the maxlength on some fields within an existing Drupal install.
Within the CMS I navigated to the field settings page and can see the maxlength value set at 30
(/admin/structure/field-collections/field-offers/fields/field_title/field-settings)
I need to increase this value, but the field is disabled and accompanied by the following message:
"There is data for this field in the database. The field settings can no longer be changed."
After some research I've found that this can be the case with Drupal 7, but are any workarounds known of? I'm loathe to modify the DB direct as I'm working on a high-traffic site with no option of downtime!
Thanks in advance,
Graham
Comments
Workaround for changing fields with data
I've had to do this kind of thing a few times. I find it works well if I back up the field data in SQL, and empty the field tables, then I can make the changes without Drupal complaining.
Here's a sample script that works on a field called "field_foo" in 4 sections to run a different stages:
Works like a charm and it's quick.
Obviously try in test environment first and do the real thing in Maintenance mode!
If at first you don’t succeed, call it version 1.0.