Problem/Motivation
The module throws a fatal error during an attempt to add a TOC block to a Layout Builder section.
Steps to reproduce
- Install the TOC API module, TOC Filter and Layout Builder modules.
- Go to a Text Filter and activate a checkbox to show a TOC in a block
- Activate a Layout Builder mode for a content type display.
- Try to add a TOC block to a Layout Builder section.
- See the fatal error.
Proposed resolution
Add a check if the $toc object is empty during a block rendering.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | block-empty-toc-3320223-2.patch | 436 bytes | chalk |
Comments
Comment #2
chalk commentedThe pretty simple patch is here.
Comment #3
chalk commentedA description update.
Comment #5
vladimirausThank you 🍻
Commited
Comment #6
vladimiraus