summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorribel2016-10-14 18:22:10 -0700
committermicropat2016-10-14 18:22:10 -0700
commita08bb2a2b922b239605a7530f31bce1a97074d0b (patch)
treef1d8cdc47199a3ea1f5b49589958100f7ae53966
parentc3b47207053f414960919a88c05df6634fbc54b4 (diff)
Issue #2816369 by ribel: Error 500 on install when a default content type has been deleted8.x-1.6
-rw-r--r--addtoany.install4
1 files changed, 3 insertions, 1 deletions
diff --git a/addtoany.install b/addtoany.install
index 7d1c94c..a9fd36f 100644
--- a/addtoany.install
+++ b/addtoany.install
@@ -27,7 +27,9 @@ function addtoany_install() {
// Get the config entity for this bundle and view mode.
$display = $storage->load('node.' . $bundle . '.' . $viewmode);
// Enable the AddToAny extra field and save the config.
- $display->setComponent('addtoany', ['weight' => $display_weight])->save();
+ if (!empty($display)) {
+ $display->setComponent('addtoany', ['weight' => $display_weight])->save();
+ }
}
}
}