From 34e88d4e588fb3cc0168ca0159e655b2aea9631a Mon Sep 17 00:00:00 2001
From: swentel <swentel@realize.be>
Date: Wed, 17 Jan 2024 16:51:55 +0100
Subject: [PATCH] Issue #3414906 by swentel, sarwan_verma, HeikkiY: Cannot use
 object of type Drupal\Core\Render\Markup as array in
 ds_theme_suggestions_alter()

---
 ds.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ds.module b/ds.module
index 46d9022f..9afb7302 100644
--- a/ds.module
+++ b/ds.module
@@ -653,7 +653,7 @@ function ds_preprocess_ds_layout(&$variables) {
  * Implements hook_theme_suggestions_alter().
  */
 function ds_theme_suggestions_alter(&$suggestions, $variables, $base_theme_hook) {
-  if (isset($variables['content']['#ds_configuration']) && !empty($variables['content']['#ds_configuration']['layout']['id']) && $base_theme_hook != 'ds_entity_view') {
+  if (isset($variables['content']) && is_array($variables['content']) && !empty($variables['content']['#ds_configuration']['layout']['id']) && $base_theme_hook != 'ds_entity_view') {
     $entity_id = $variables['content']['#' . $variables['content']['#entity_type']]->id();
     $layout_hook = $variables['content']['#ds_configuration']['layout']['id'];
     if (!\Drupal::config('ds.settings')->get('layout_suggestion_bc')) {
-- 
GitLab