Mercurial > hg > isophonics-drupal-site
diff core/lib/Drupal/Core/Entity/ContentEntityBase.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 1fec387a4317 |
children | 129ea1e6d783 |
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php Thu Apr 26 11:26:54 2018 +0100 +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php Tue Jul 10 15:07:59 2018 +0100 @@ -772,11 +772,11 @@ * {@inheritdoc} */ public function onChange($name) { - // Check if the changed name is the value of an entity key and if the value - // of that is currently cached, if so, reset it. Exclude the bundle from - // that check, as it ready only and must not change, unsetting it could + // Check if the changed name is the value of any entity keys and if any of + // those values are currently cached, if so, reset it. Exclude the bundle + // from that check, as it ready only and must not change, unsetting it could // lead to recursions. - if ($key = array_search($name, $this->getEntityType()->getKeys())) { + foreach (array_keys($this->getEntityType()->getKeys(), $name, TRUE) as $key) { if ($key != 'bundle') { if (isset($this->entityKeys[$key])) { unset($this->entityKeys[$key]);