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.
We're attempting to convert from using allowed_values to an allowed_values_function but we get a FieldUpdateForbiddenException from list_field_update_forbid(). It would be nice if this could be skipped if allowed_values_function is being used.
Comments
Comment #1
Dave ReidComment #2
m.stenta+1 for this.
The same code exists in Drupal 8 as well, so it should probably be fixed there first.
https://api.drupal.org/api/drupal/core!modules!field!field.api.php/funct...
Comment #3
m.stentaHere's a patch for 8.0.x.
Comment #5
m.stentaOh... I also just found an issue with the original patch for 7.x. It should be checking $field['settings']['allowed_values_function'], but instead it is checking $field['allowed_values_function'].
Attached is a new patch for 7.x as well.
Comment #6
m.stentaOops... can't check a field setting within empty(). Attached is a new 8.x patch.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous at Druid commentedShall we wait until php 5.5 has been updated to test bot? https://www.drupal.org/node/2296557
so we could use the method return value in function.
Comment #9
mgiffordComment #14
iSoLate CreditAttribution: iSoLate at Randstad Digital commentedRerolling the patch for 7.x because it misses the ['settings'] array key.