Problem/Motivation

After running the "delete blocks" batch task an error appears. The task runs but aftewards you get this error.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=4&op=do_nojs&op=do
StatusText: parsererror
ResponseText: 
Warning: Undefined array key 1 in Drupal\layout_builder_block_delete\LayoutBuilderBlockDeleteBatch::batchDeleteAllBlocks() (line 96 of /var/www/html/web/modules/contrib/layout_builder_block_delete/src/LayoutBuilderBlockDeleteBatch.php)
TypeError: Drupal\layout_builder_block_delete\LayoutBuilderBlockDeleteManager::deleteBlocks(): Argument #1 ($nid) must be of type int, null given, called in /var/www/html/web/modules/contrib/layout_builder_block_delete/src/LayoutBuilderBlockDeleteBatch.php on line 96 in Drupal\layout_builder_block_delete\LayoutBuilderBlockDeleteManager->deleteBlocks() (line 160 of /var/www/html/web/modules/contrib/layout_builder_block_delete/src/LayoutBuilderBlockDeleteManager.php)

The blocks are deleted but it should be clean if the error is fixed as well.

Steps to reproduce

  1. Do a clean Drupal install
  2. Install & enable Layout Builder and Layout Builder Delete Block.
  3. Setup Layout Builder on a content type (ex. Basic Page).
  4. Add a node for the content type and add some blocks.
  5. Run the Layout Builder Delete Block batch task.

Proposed resolution

None.

Remaining tasks

Find the bug. Fix the bug. Test if your solution works.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#5 PXL_20220903_144356552.jpg291.63 KBmatdemeue
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

matdemeue created an issue. See original summary.

matdemeue’s picture

Issue summary: View changes

matdemeue’s picture

Status: Active » Needs review

Please review my fix for this issue.

matdemeue’s picture

Assigned: matdemeue » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new291.63 KB

Reviewed with some colleagues.

Our little community at work.

  • matdemeue committed 73f57e4 on 1.0.x
    Issue #3307751 by matdemeue: Ajax error after running "delete blocks"...
matdemeue’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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