diff --git a/modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php b/modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php index 88918ad02a10ecf6133e28eef72563eaf02bae04..bc260bac8ad35c4f241671347c8bd471255c36ee 100644 --- a/modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php +++ b/modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php @@ -346,7 +346,14 @@ class LeafletMarker extends RowPluginBase implements ContainerFactoryPluginInter if ($this->options['description_field'] === '#rendered_entity' && is_object($row->_entity)) { $entity = $row->_entity; $build = $this->getEntityManager()->getViewBuilder($entity->getEntityTypeId())->view($entity, $this->options['view_mode']); - $popup_body = $this->renderer->renderInIsolation($build); + // Render popup body, + // ensuring backward compatibility (with Drupal < 10.2). + if (method_exists($this->renderer, 'renderInIsolation')) { + $popup_body = $this->renderer->renderInIsolation($build); + } + else { + $popup_body = $this->renderer->renderPlain($build); + } } // Normal rendering via fields. elseif ($this->options['description_field']) { diff --git a/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php b/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php index 89ecb390286bf6dcced655446de9179dcc80d62d..71b4f408bdfae19ba0352c97a94675bd83657dfe 100644 --- a/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php +++ b/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php @@ -1264,7 +1264,14 @@ class LeafletMap extends StylePluginBase implements ContainerFactoryPluginInterf $render_row = [ "markup" => $this->view->rowPlugin->render($result), ]; - $popup_content = $this->renderer->renderInIsolation($render_row); + // Render popup content, ensuring backward compatibility + // (with Drupal < 10.2). + if (method_exists($this->renderer, 'renderInIsolation')) { + $popup_content = $this->renderer->renderInIsolation($render_row); + } + else { + $popup_content = $this->renderer->renderPlain($render_row); + } break; default: