AJAX HTTP error when executing Batch Update -> $section->getComponentes()

Created on 9 August 2024, 2 months ago

Problem/Motivation

After set entity_usage configuration, using the layout builder module.
The batch returns this error in dblog:
Uncaught PHP Exception Error: Call to a member function getComponents() on bool in Drupal\entity_usage\Plugin\EntityUsage\Track\LayoutBuilder->getTargetEntities() (line 103 of <web_path>/modules/contrib/entity_usage/src/Plugin/EntityUsage/Track/LayoutBuilder.php).

Steps to reproduce

  • Configure the website to use layout_builder in a node type
  • Got to the admin url ***, to configure entity_usage.
  • Configure targets as block_content, media
  • Configure sources as content, block_content,media
  • In the batch tab, execute the batch
  • Wait for the message during the node step process

Proposed resolution

In the file modules/contrib/entity_usage/src/Plugin/EntityUsage/Track/LayoutBuilder.php
Before the line foreach ( $section->getComponents() as $component) {
Add those lines:

if (FALSE === $section) {
    continue;
}

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France frondeau Nantes, FRANCE

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024