Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityDisplayBase.php
index 34ce858b13dc9d5c6d8c5e833d98a576d2285a73..dbda544ef050545719037f638285dd161d9e8492 100644 (file)
@@ -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'.