Error: Call to a member function getConfig() OverridesSectionStorage.php

Created on 8 February 2024, 10 months ago

Problem/Motivation

Getting The website encountered an unexpected error. Try again later. when accessing the edit user page.

Error: Call to a member function getConfig() on null in Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage->handleTranslationAccess() (line 26 of ../modules/contrib/layout_builder_st/src/Plugin/SectionStorage/OverridesSectionStorage.php).

Steps to reproduce

Updated to core to 10.2.3 and tried to edit a user

๐Ÿ› Bug report
Status

Active

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @mellowtothemax
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohd sahzad

    Mohd Sahzad โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !6changes for getConfig method null โ†’ (Open) created by mohd sahzad
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    40 pass
  • Status changed to Needs review 10 months ago
  • Thanks for the swift reply. Unfortunately the patch didn't work. Still getting the same error. Please note that my Drupal version is 10.2.3 and PHP 8.1

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justcaldwell Austin, Texas

    We're seeing the same issue when we try to edit ANY entity. This is after updating to Drupal 10.2.3 also (PHP 8.2).

    The patch had no effect.

  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justcaldwell Austin, Texas

    Correction #6 aboveโ€”we can't edit any entity unless the entity allows Layout Builder Overrides.

    First guess is that this stems from changes made in ๐Ÿ› Layout Builder overrides section storage sets local tasks block cache max-age to 0 on content entity pages without overrides enabled RTBC . Looks like the parent class (core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php) no longer ensures that the entity has the layout_builder__layout field, so the code is failing on any entity without LB Overrides.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    40 pass
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justcaldwell Austin, Texas

    The last change to the MR worked for me in local testing.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    40 pass
  • This worked for me too. Thank you.

  • Status changed to RTBC 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States millerrs

    I can verify that the error occurs after upgrading to Drupal 10.2.3 (my PHP version is 8.2), and it is addressed by the most recent change to the MR.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany guido_s Cologne

    I had this error even when viewing the frontpage and not editing the content.
    Applying the diff of the merge request as patch in composer solved the issue.
    My Drupal version is 10.2.3.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chuck_theobald

    Viewing the front page of one of my sites generated WSOD. I've got a few other sites on the same composer.json that are not showing this error.
    I'm reverting to 10.2.2 until this is fixed without needing a patch.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 9 months ago
    40 pass
  • Just wanted to upload the patch of merge request in #3

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Anybody Porta Westfalica

    Same issue here, confirming #12. Are the maintainers aware of this?

  • ๐Ÿ‡ญ๐Ÿ‡บHungary junkuncz

    I can also confirm #12.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland handkerchief

    I'm on Drupal 10.2.4
    The patch doesn't work, new code base.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland handkerchief

    Ok my bad, patch #15 is working, but something was wrong with the import.

  • ๐Ÿ‡ง๐Ÿ‡ทBrazil carolpettirossi Campinas - SP

    I ran into this issue after running "composer update -W".

    I'm on Drupal Core 10.2.4 and layout_builder_st 1.0.0-alpha3

    Applying patch #15 solved the issue!

  • Patch #15 fixed the issue!

  • Patch #15 worked fine.
    Drupal 10.2.4
    PHP 8.1.27
    Drush version 12.4.4.0

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom webfaqtory

    Patch #15 didn't apply for me in D10.2.4. Made a simpler patch that applies in 10.2.4

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada Captain_Canuck

    Patch #15 applied for me in Drupal 10.2.4, and patch #23 had several failed hunks:

    Downloading https://www.drupal.org/files/issues/2024-03-20/3420063-23.patch
    patch '-p1' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    Executing command (CWD): patch '-p1' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    |index 4f020bab8d..704b062f05 100644
    |--- a/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    |+++ b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    --------------------------
    File to patch:
    Skip this patch? [y]
    Skipping patch.
    
    1 out of 1 hunk ignored
    
    patch '-p0' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    Executing command (CWD): patch '-p0' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    |index 4f020bab8d..704b062f05 100644
    |--- a/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    |+++ b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    --------------------------
    File to patch:
    Skip this patch? [y]
    Skipping patch.
    
    1 out of 1 hunk ignored
    
    patch '-p2' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    Executing command (CWD): patch '-p2' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    |index 4f020bab8d..704b062f05 100644
    |--- a/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    |+++ b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    --------------------------
    File to patch:
    Skip this patch? [y]
    Skipping patch.
    
    1 out of 1 hunk ignored
    
    patch '-p4' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    Executing command (CWD): patch '-p4' --no-backup-if-mismatch -d 'docroot/modules/contrib/layout_builder_st' < '/tmp/65fb5f91524e1.patch'
    patching file src/Plugin/SectionStorage/OverridesSectionStorage.php
    
    Hunk #1 FAILED at 380.
    
    1 out of 1 hunk FAILED -- saving rejects to file src/Plugin/SectionStorage/OverridesSectionStorage.php.rej
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 8 months ago
    33 pass, 8 fail
  • ๐Ÿ‡จ๐Ÿ‡ณChina eugeney

    For drupal 10.2.4

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.x + Environment: PHP 8.2 & MySQL 8
    last update 8 months ago
    33 pass, 8 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 8 months ago
    40 pass
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance slayne40

    $field_config undefined after patch #25

  • Status changed to Needs review 8 months ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 8 months ago
    40 pass
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.x + Environment: PHP 8.2 & MySQL 8
    last update 8 months ago
    33 pass, 8 fail
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arulplay

    The website encountered an unexpected error. Please try again later.

    Error: Call to a member function getClientArgs() on null in Drupal\aws\AwsClientFactory->getClient() (line 43 of modules\contrib\aws\src\AwsClientFactory.php).
    Drupal\amazon_ses\AmazonSesHandler->__construct(Object, Object, Object, Object, Object) (Line: 259)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'amazon_ses.handler') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('amazon_ses.handler') (Line: 20)
    Drupal\amazon_ses\Form\AmazonSesFormBase::create(Object) (Line: 28)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\amazon_ses\Form\AmazonSesIdentitiesForm') (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\amazon_ses\Form\AmazonSesIdentitiesForm') (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->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: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia avinashm

    Patch #15 worked for me on D10.2.7 and PHP 8.2.15

  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡ง๐Ÿ‡ทBrazil carolpettirossi Campinas - SP

    This issue also occurred on Drupal 10.3.1 when I tried to edit a user.

    Patch from #26 did solve the issue.

  • ๐Ÿ‡ง๐Ÿ‡ทBrazil igorgoncalves

    Same as @carolpettirossi and @avinashm above.

    Patch #26 worked on D10.2.7!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States urmoucher

    Tried patch #26 on Drupal 10.3.5/PHP 8.2 -- did not solve the problem/

  • ๐Ÿ‡ช๐Ÿ‡ธSpain joe_carvajal Seville (Spain)

    I also confirm that #26 works with D10.3.1 and LB Symmetric alpha3

  • ++ for the patch in #26, please get this committed.

Production build 0.71.5 2024