"Error: Call to a member function delete() on null in delete_all_content_batch_delete()"

Created on 13 June 2023, about 1 year ago
Updated 20 September 2023, 9 months ago

Problem/Motivation

drush dadc can show the following error.

Error: Call to a member function delete() on null in delete_all_content_batch_delete() (line 61 of /modules/contrib/delete_all/includes/delete_all.content.batch.inc).

Steps to reproduce

Terminate drush dadc and then start it again.

Proposed resolution

Before deleting a node, check the $node variable is not NULL.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇺🇸United States ben.hamelin Adirondack Mountains, NY

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

Comments & Activities

  • Issue created by @ben.hamelin
  • @benhamelin opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India ayush.pandey

    Tested the module with version 3.0.0 on D9, and the issue seems to be not reproducible after trying multiple ways. The $node->delete() under function delete_all_content_batch_delete() seems to validate itself already for null check on (!empty($nodes_to_delete)) . Please provide steps to reproduce this (if reproducible) with drush commands.

  • 🇨🇦Canada danrod

    I am having the same situation here, couldn't reproduce the issue.

  • 🇺🇸United States ben.hamelin Adirondack Mountains, NY

    I am guessing this was an issue with the site we first encountered the issue on. It was a rather large site (60,000+ nodes) that had been migrated from D7 and had some legacy code and data. I'm not sure what led to the initial error but this definitely fixed the issue for us.

    Happy to let this close out if you feel it's not worthwhile.

  • 🇺🇸United States ben.hamelin Adirondack Mountains, NY

    I am guessing this was an issue with the site we first encountered the issue on. It was a rather large site (60,000+ nodes) that had been migrated from D7 and had some legacy code and data. I'm not sure what led to the initial error but this definitely fixed the issue for us.

    Happy to let this close out if you feel it's not worthwhile.

Production build 0.69.0 2024