From 998c89fc5b8dcd478e3bfcb88ec69b56f22f5fcf Mon Sep 17 00:00:00 2001 From: itamair Date: Fri, 21 Dec 2018 22:23:23 +0100 Subject: [PATCH] leaflet-2973818-13-Breaks-with-Search-API.patch applied --- leaflet_views/src/Plugin/views/style/LeafletMap.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/leaflet_views/src/Plugin/views/style/LeafletMap.php b/leaflet_views/src/Plugin/views/style/LeafletMap.php index 34ba605..ab6df2b 100644 --- a/leaflet_views/src/Plugin/views/style/LeafletMap.php +++ b/leaflet_views/src/Plugin/views/style/LeafletMap.php @@ -180,9 +180,9 @@ class LeafletMap extends StylePluginBase implements ContainerFactoryPluginInterf } } // Set entity info for Search API views. - if (\Drupal::moduleHandler()->moduleExists('search_api') && substr($base_table, 0, 17) === 'search_api_index_') { - $indexId = substr($base_table, 17); - $index = Index::load($indexId); + if ($this->moduleHandler->moduleExists('search_api') && substr($base_table, 0, 17) === 'search_api_index_') { + $index_id = substr($base_table, 17); + $index = Index::load($index_id); foreach ($index->getDatasources() as $datasource) { if ($datasource instanceof DatasourceInterface) { $this->entityType = $datasource->getEntityTypeId(); @@ -369,9 +369,9 @@ class LeafletMap extends StylePluginBase implements ContainerFactoryPluginInterf } elseif (isset($result->_object)) { // Search API provides a TypedData EntityAdapter. - $entityAdapter = $result->_object; - if ($entityAdapter instanceof EntityAdapter) { - $entity = $entityAdapter->getValue(); + $entity_adapter = $result->_object; + if ($entity_adapter instanceof EntityAdapter) { + $entity = $entity_adapter->getValue(); } } -- 2.18.0