field.api.php's hook_field_storage_config_update_forbid() has code like:
$field_storage['settings']['allowed_values']
$prior_field_storage['field_name']

Comments

yched’s picture

Status: Active » Needs review
StatusFileSize
new3.12 KB

That code was taken from options_field_storage_config_update_forbid(), copy/pasting the current code.

andypost’s picture

+++ b/core/modules/field/field.api.php
@@ -76,21 +76,13 @@ function hook_field_info_alter(&$info) {
-      throw new \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException("Cannot update a list field storage not to include keys with existing data");
...
+      throw new FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field_storage->getName())));

+++ b/core/modules/options/options.module
@@ -101,7 +101,7 @@ function options_field_storage_config_update_forbid(FieldStorageConfigInterface
-      throw new FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field_storage->getName())));
+      throw new \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field_storage->getName())));

suppose api.php should use full path

yched’s picture

Facepalm. I did add the full path, but in the original code in options.module :-/...

swentel’s picture

Status: Needs review » Reviewed & tested by the community

alright

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Well that's definitely much nicer!

Committed and pushed to 8.x. Thanks!

  • webchick committed 5379584 on 8.0.x
    Issue #2344843 by yched: Fixed hook_field_storage_config_update_forbid...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.