Issue #3199582 by shriaas2898: hook_field_storage_config_update_forbid example uses access to protected member of implementing class

merge-requests/366/head
shriaas2898 2021-02-27 21:57:05 +00:00 committed by larowlan
parent 0e13819245
commit 346d176c76
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ function hook_field_ui_preconfigured_options_alter(array &$options, $field_type)
* @see entity_crud
*/
function hook_field_storage_config_update_forbid(\Drupal\field\FieldStorageConfigInterface $field_storage, \Drupal\field\FieldStorageConfigInterface $prior_field_storage) {
if ($field_storage->module == 'options' && $field_storage->hasData()) {
if ($field_storage->getTypeProvider() == 'options' && $field_storage->hasData()) {
// Forbid any update that removes allowed values with actual data.
$allowed_values = $field_storage->getSetting('allowed_values');
$prior_allowed_values = $prior_field_storage->getSetting('allowed_values');