Skip to content
Snippets Groups Projects

Fix @todo item.

Closes #3008943

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
135 135 * The parent entity.
136 136 */
137 137 public function handleEntityDelete(EntityInterface $entity) {
138 // @todo In https://www.drupal.org/node/3008943 call
139 // \Drupal\layout_builder\LayoutEntityHelperTrait::isLayoutCompatibleEntity().
140 $this->usage->removeByLayoutEntity($entity);
138 if ($this->isLayoutCompatibleEntity($entity)) {
139 $this->usage->removeByLayoutEntity($entity);
140 }
  • Comment on lines -138 to +140

    Why do we need to do the check at all? Wouldn't it be safer just to to the removeByLayoutEntity() anyway - just to ensure the table is cleaned up.

  • Brandon Lira changed this line in version 2 of the diff

    changed this line in version 2 of the diff

  • You're right to question the necessity of this check. I removed the isLayoutCompatibleEntity($entity) verification before calling removeByLayoutEntity($entity), as it seemed redundant.

    I ran the full test suite, including kernel and functional tests for Layout Builder, and they all passed successfully without any errors. This indicates that calling removeByLayoutEntity() unconditionally does not introduce any issues.

    Edited by Brandon Lira
  • Please register or sign in to reply
  • Brandon Lira added 1 commit

    added 1 commit

    • 64bff19c - Issue #3008943: Removed isLayoutCompatibleEntity() verification before calling...

    Compare with previous version

  • Brandon Lira added 1811 commits

    added 1811 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading