diff core/lib/Drupal/Core/Entity/EntityDisplayBase.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 7a779792577d
children 129ea1e6d783
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php	Mon Apr 23 09:46:53 2018 +0100
@@ -190,11 +190,11 @@
           }
 
           if (!empty($options['region']) && $options['region'] === 'hidden') {
-            $this->hidden[$name] = TRUE;
+            $this->removeComponent($name);
           }
           elseif ($options) {
             $options += ['region' => $default_region];
-            $this->content[$name] = $this->pluginManager->prepareConfiguration($definition->getType(), $options);
+            $this->setComponent($name, $options);
           }
           // Note: (base) fields that do not specify display options are not
           // tracked in the display at all, in order to avoid cluttering the
@@ -250,7 +250,7 @@
   /**
    * {@inheritdoc}
    */
-  public function preSave(EntityStorageInterface $storage, $update = TRUE) {
+  public function preSave(EntityStorageInterface $storage) {
     // Ensure that a region is set on each component.
     foreach ($this->getComponents() as $name => $component) {
       $this->handleHiddenType($name, $component);
@@ -263,7 +263,7 @@
 
     ksort($this->content);
     ksort($this->hidden);
-    parent::preSave($storage, $update);
+    parent::preSave($storage);
   }
 
   /**