Deprecated function error on Layout Sections page

Created on 22 November 2023, 7 months ago
Updated 30 May 2024, 29 days ago

Problem/Motivation

Using Drupal 10.1.6.
I noticed some odd things about how our Layout Paragraphs are being rendered in Drupal 10, compared to Drupal 9. I wanted to investigate settings in Layout Paragraph admin configuration. When I click on the "Layout Sections" tab, the page crashes with errors. All of the errors are the same type of error.

Deprecated function: strnatcasecmp(): Passing null to parameter #1 ($string1) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of /home/limestonedouglas/test/web/core/lib/Drupal/Core/Layout/LayoutPluginManager.php). =>

array:28 [▼
"27: strnatcasecmp()" => array:1 [▶]
"26: Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}()" => array:2 [▶]
"25: uasort()" => array:1 [▶]
"24: Drupal\Core\Layout\LayoutPluginManager->getSortedDefinitions()" => array:2 [▶]
"23: Drupal\Core\Layout\LayoutPluginManager->getGroupedDefinitions()" => array:1 [▶]
"22: Drupal\Core\Layout\LayoutPluginManager->getLayoutOptions()" => array:1 [▶]
"21: Drupal\layout_paragraphs\Form\LayoutParagraphsSectionsSettingsForm->buildForm()" => array:2 [▶]
"20: call_user_func_array()" => array:1 [▶]
"19: Drupal\Core\Form\FormBuilder->retrieveForm()" => array:2 [▶]
"18: Drupal\Core\Form\FormBuilder->buildForm()" => array:2 [▶]
"17: Drupal\Core\Controller\FormController->getContentResult()" => array:2 [▶]
"16: call_user_func_array()" => array:1 [▶]
"15: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()" => array:1 [▶]
"14: Drupal\Core\Render\Renderer->executeInRenderContext()" => array:2 [▶]
"13: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()" => array:2 [▶]
"12: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()" => array:1 [▶]
"11: Symfony\Component\HttpKernel\HttpKernel->handleRaw()" => array:2 [▶]
"10: Symfony\Component\HttpKernel\HttpKernel->handle()" => array:2 [▶]
"\u{A0}9: Drupal\Core\StackMiddleware\Session->handle()" => array:2 [▶]
"\u{A0}8: Drupal\Core\StackMiddleware\KernelPreHandle->handle()" => array:2 [▶]
"\u{A0}7: Drupal\page_cache\StackMiddleware\PageCache->pass()" => array:2 [▶]
"\u{A0}6: Drupal\page_cache\StackMiddleware\PageCache->handle()" => array:2 [▶]
"\u{A0}5: Drupal\ban\BanMiddleware->handle()" => array:2 [▶]
"\u{A0}4: Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()" => array:2 [▶]
"\u{A0}3: Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()" => array:2 [▶]
"\u{A0}2: Drupal\Core\StackMiddleware\StackedHttpKernel->handle()" => array:2 [▶]
"\u{A0}1: Drupal\Core\DrupalKernel->handle()" => array:2 [▶]
"\u{A0}0: main()" => array:2 [▶]
]

I found some Drupal core issues that might be related. However, those issues appear to sometimes be brought on by installed modules. I'm not sure if this has come up for anyone already here, so I thought I'd start here.

Here are some related issues I found to this error:
https://www.drupal.org/project/drupal/issues/3392572 🐛 Add missing category to Drupal\layout_builder\Plugin\Layout\BlankLayout and let modules and themes alter the list of layouts RTBC
https://www.drupal.org/project/drupal/issues/3316811 🐛 strnatcasecmp(): Passing null to parameter #1 ($string) of type string is deprecated Closed: duplicate
https://www.drupal.org/project/drupal/issues/3315678 🐛 strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated Needs work

Steps to reproduce

In Drupal 10.1.6, with this module installed, go to Admin configuration -> Layout Paragraphs, then select Layout Sections.

Thanks for any pointers

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States rraney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024