diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index a9b6d97..d23341b 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -220,9 +220,9 @@ public function save(EntityInterface $entity) { // @see \Drupal\Core\Config\Entity\ConfigEntityStorage::MAX_ID_LENGTH // @todo Consider moving this to a protected method on the parent class, and // abstracting it for all entity types. - if (strlen($entity->{$this->idKey}) > self::MAX_ID_LENGTH) { + if (strlen($entity->get($this->idKey)) > self::MAX_ID_LENGTH) { throw new ConfigEntityIdLengthException(String::format('Configuration entity ID @id exceeds maximum allowed length of @length characters.', array( - '@id' => $entity->{$this->idKey}, + '@id' => $entity->get($this->idKey), '@length' => self::MAX_ID_LENGTH, ))); } diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php index 07ec50a..6dbff85 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php @@ -48,7 +48,7 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface { * * @var string */ - public $id; + protected $id; /** * The human-readable name of the configuration entity.