X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FEntityDisplayBase.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FEntityDisplayBase.php;h=dbda544ef050545719037f638285dd161d9e8492;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=34ce858b13dc9d5c6d8c5e833d98a576d2285a73;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php index 34ce858b1..dbda544ef 100644 --- a/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php +++ b/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php @@ -163,12 +163,12 @@ abstract class EntityDisplayBase extends ConfigEntityBase implements EntityDispl if (!isset($this->content[$name]) && !isset($this->hidden[$name])) { // Extra fields are visible by default unless they explicitly say so. if (!isset($definition['visible']) || $definition['visible'] == TRUE) { - $this->content[$name] = [ - 'weight' => $definition['weight'] - ]; + $this->setComponent($name, [ + 'weight' => $definition['weight'], + ]); } else { - $this->hidden[$name] = TRUE; + $this->removeComponent($name); } } // Ensure extra fields have a 'region'.