getEntityTypeId() method fails on layout page without blocks

Created on 27 June 2024, about 1 year ago

Problem/Motivation

Fatal indicating that getEntityTypeId() method cannot be called on NULL block.

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 [];
    }
πŸ› Bug report
Status

Needs review

Version

10.2 ✨

Component
Layout builderΒ  β†’

Last updated 1 day 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 β†’ (Closed) created by EthanT
  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida
  • Pipeline finished with Failed
    about 1 year ago
    Total: 216s
    #210126
  • Pipeline finished with Success
    about 1 year ago
    #210133
  • Status changed to Needs work about 1 year 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

    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 1 year 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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since there's been no follow up to #7 going to close out. If still a bug in D11 please re-open

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

    I've got this issue on 10.5.1 without lb_plus.

    Applying the fix for D11 to core/modules/layout_builder/src/Plugin/Block/InlineBlock.php resolves the issue for me.

    This has not been back ported to D10.

  • πŸ‡³πŸ‡ΏNew Zealand danielveza Brisbane, AU

    @danwonac Are you able to provide any steps on how you could replicate this? Did you have any other contributed LB related modules on the site?

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

    I was migrating a site from latest D9.5.11 to D10. The site uses Layout Builder Restrictions and Layout Builder Styles.

Production build 0.71.5 2024