Problem/Motivation

The module throws a fatal error during an attempt to add a TOC block to a Layout Builder section.

Steps to reproduce

  1. Install the TOC API module, TOC Filter and Layout Builder modules.
  2. Go to a Text Filter and activate a checkbox to show a TOC in a block
  3. Activate a Layout Builder mode for a content type display.
  4. Try to add a TOC block to a Layout Builder section.
  5. See the fatal error.

Proposed resolution

Add a check if the $toc object is empty during a block rendering.

CommentFileSizeAuthor
#2 block-empty-toc-3320223-2.patch436 byteschalk

Comments

Chalk created an issue. See original summary.

chalk’s picture

Status: Active » Needs review
StatusFileSize
new436 bytes

The pretty simple patch is here.

chalk’s picture

Issue summary: View changes

A description update.

  • VladimirAus committed 6dd80994 on 8.x-1.x authored by Chalk
    Issue #3320223 by Chalk, VladimirAus: Fatal error during a configuration...
vladimiraus’s picture

Assigned: chalk » Unassigned
Status: Needs review » Reviewed & tested by the community

Thank you 🍻
Commited

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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