From 5de2ec72207ef04086c1e631515ece558039f9a1 Mon Sep 17 00:00:00 2001 From: alexpott Date: Thu, 18 May 2017 11:37:22 -0500 Subject: [PATCH] Issue #2872751 by alexpott, markcarver, aspilicious: The service "plugin.manager.bootstrap_layouts" has a dependency on a non-existent service --- bootstrap_layouts.install | 4 ++-- bootstrap_layouts.module | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bootstrap_layouts.install b/bootstrap_layouts.install index e616ee6..c8f7252 100644 --- a/bootstrap_layouts.install +++ b/bootstrap_layouts.install @@ -19,8 +19,8 @@ function _bootstrap_layouts_update($schema) { $container = \Drupal::getContainer(); - // Rebuild the container if the bootstrap layouts manager doesn't exist. - if (!$container->has('plugin.manager.bootstrap_layouts')) { + // Rebuild the container if the layout managers don't exist. + if (!$container->has('plugin.manager.core.layout') || !$container->has('plugin.manager.bootstrap_layouts')) { drupal_flush_all_caches(); } diff --git a/bootstrap_layouts.module b/bootstrap_layouts.module index 2f0681b..6f0dba5 100644 --- a/bootstrap_layouts.module +++ b/bootstrap_layouts.module @@ -15,6 +15,12 @@ use Drupal\Core\Template\Attribute; * Implements hook_theme_registry_alter(). */ function bootstrap_layouts_theme_registry_alter(&$theme_registry) { + // Immediately return if the layout manager cannot be loaded. + // This can happen during the update process. + if (!\Drupal::hasService('plugin.manager.core.layout')) { + return; + } + // Find all Bootstrap Layouts. $layouts = \Drupal::service('plugin.manager.core.layout')->getDefinitions(); $layout_theme_hooks = []; -- 2.12.2