(un)lock an existing Field for edit with Devel

Public

Un(lock) an existing Field for edit with Devel module

</> CopyGet raw version
php
  1. /*
  2. #
  3. # You can use Devel-Module to unlock/lock a exising field where you would otherwise get an error like "The field xxxx is locked and cannot be edited."
  4. #
  5. # Change the 'xxx' on line 1 with the machine readable name of your field.
  6. */
  7. $field_name = 'xxx';
  8. $field = field_read_field($field_name);
  9. $field['locked'] = 1;
  10. field_update_field($field);