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
- Do a clean Drupal install
- Install & enable Layout Builder and Layout Builder Delete Block.
- Setup Layout Builder on a content type (ex. Basic Page).
- Add a node for the content type and add some blocks.
- 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.
Comments
Comment #2
matdemeueComment #4
matdemeuePlease review my fix for this issue.
Comment #5
matdemeueReviewed with some colleagues.
Comment #7
matdemeue