getEntityTypeId() method fails on layout page without blocks

Created on 27 June 2024, 2 months ago
Updated 11 July 2024, about 2 months ago

Problem/Motivation

Fatal indicating that getEntityTypeId() method cannot be called on NULL block in core/modules/layout_builder/src/Plugin/Block/InlineBlock.php

Steps to reproduce

  1. Install lb_plus
  2. Turn on individual layouts for a vocabulary
  3. Visit layout page for vocabulary
  4. See fatal indicating that getEntityTypeId() method cannot be called on NULL block.

Proposed resolution

Add this to build method:

    if (empty($block)) {
      return [];
    }

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

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

Merge Requests

Comments & Activities

  • Issue created by @EthanT
  • Merge request !8563Update InlineBlock.php β†’ (Open) created by EthanT
  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida
  • Pipeline finished with Failed
    2 months ago
    Total: 216s
    #210126
  • Pipeline finished with Success
    2 months ago
    #210133
  • Status changed to Needs work 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Same deal

    So with issues like this need to some research/backtracing to figure out why it's not assumed to be a string. Putting a check may make the warning go away but could be hiding a larger issue.

    MR should be against 11.x as the current development branch

    Also steps include a contrib module this reproducible without? Could be a bug with the contrib.

  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

    Could very well be, but I think it’s worth investigating.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    Fixes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies. Also, 10.2 is in security mode now.

  • Status changed to Postponed: needs info about 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand DanielVeza Brisbane, AU

    Thanks for raising an issue!

    Can this be replicated without the contributed module? If not could we please get a backtrace? It may help identify if this is something that should be fixed in core or in lb_plus.

Production build 0.71.5 2024