Problem/Motivation

The website encountered an unexpected error. Try again later. TypeError: Unsupported operand types: null + array in ds_preprocess_ds_layout() (line 479 of modules/contrib/ds/ds.module). call_user_func_array('ds_preprocess_ds_layout', Array) (Line: 316) Drupal\Core\Theme\ThemeManager->Drupal\Core\Theme\{closure}('ds_preprocess_ds_layout') (Line: 340) Drupal\Core\Theme\ThemeManager->render('ds_2col_fluid', Array) (Line: 500) Drupal\Core\Render\Renderer->doRender(Array, Object) (Line: 230) Drupal\Core\Render\Renderer->render(Array) (Line: 501) Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 44) __TwigTemplate_b65680af61d304b04509a45375461dcd->doDisplay(Array, Array) (Line: 402) Twig\Template->yield(Array) (Line: 386) Twig\Template->render(Array) (Line: 51) Twig\TemplateWrapper->render(Array) (Line: 35) Drupal\Core\Template\TwigThemeEngine->renderTemplate('modules/contrib/ds/templates/ds-entity-view.html.twig', Array) (Line: 428) Drupal\Core\Theme\ThemeManager->render('ds_entity_view', Array) (Line: 500) Drupal\Core\Render\Renderer->doRender(Array, Object) (Line: 230) Drupal\Core\Render\Renderer->render(Array, ) (Line: 242) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 634) Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}() Fiber->resume() (Line: 649) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235) Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 131) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 246) Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object, 'kernel.view', Object) (Line: 206) Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'kernel.view', Object) (Line: 56) Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object, 'kernel.view') (Line: 188) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 54) Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 53) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 263) Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 130) Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 745) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Upgrade to 3.x-dev

I think it happens on content types not using display suite? Not sure actually.

Proposed resolution

/**
* Process layout.
*
* This function is added in ds_theme_registry_alter().
*/
function ds_preprocess_ds_layout(&$variables) {
$layout_settings = $variables['settings'] ?? [];
$layout_settings += ['wrappers' => []];

Issue fork ds-3564007

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

loopy1492 created an issue. See original summary.

loopy1492’s picture

Issue summary: View changes
swentel’s picture

Hmm, patch makes sense in a way. Is this on D11 ? And maybe PHP 8.4?

jelle_s’s picture

I'm experiencing this on 11.3.1 and php 8.3

swentel’s picture

Status: Active » Needs review

Look at this one, I hope to reproduce it, but patch in itself makes sense, so will merge in pretty soon.

swentel’s picture

Status: Needs review » Fixed

Couldn't reproduce, but oh well. Merged in, will trigger a new release later this day.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

swentel’s picture

Status: Fixed » Closed (fixed)