Problem/Motivation

The getLayout() method in Drupal\layout_library\Plugin\SectionStorage\Library relies on getSectionList(), which may return NULL if the necessary layout context is missing/not required. This creates potential for null reference errors in dependent methods, such as initLayoutOverrides() which assumes getLayout() will always return a valid layout instance.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

tuwebo created an issue. See original summary.

tuwebo’s picture

Title: Null context in getLayout() causes potential null reference errors » 'layout' context in getLayout() causes potential null reference errors

akalam changed the visibility of the branch 3487820-layout-context-in to hidden.

unstatu made their first commit to this issue’s fork.

  • unstatu committed c7d5c525 on 1.0.x authored by tuwebo
    Issue #3487820: 'layout' context in getLayout() causes potential null...
unstatu’s picture

Thanks for the contribution. Merged!

unstatu’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.