AssertionError: Cannot load the "file" entity with NULL ID

Created on 26 June 2024, 3 days ago

Problem/Motivation

Programmatically deleting nodes with a calendar download field triggers this error:

[error]  AssertionError: Cannot load the "file" entity with NULL ID. in assert() (line 261 of /var/www/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php) #0 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(261): assert(false, 'Cannot load the...')
#1 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(488): Drupal\Core\Entity\EntityStorageBase->load(NULL)
#2 /var/www/docroot/modules/contrib/ics_field/src/Plugin/Field/FieldType/CalendarDownloadType.php(196): Drupal\Core\Entity\EntityBase::load(NULL)
#3 /var/www/docroot/core/lib/Drupal/Core/Field/FieldItemList.php(233): Drupal\ics_field\Plugin\Field\FieldType\CalendarDownloadType->delete()
#4 /var/www/docroot/core/lib/Drupal/Core/Field/FieldItemList.php(206): Drupal\Core\Field\FieldItemList->delegateMethod('delete')
#5 /var/www/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(939): Drupal\Core\Field\FieldItemList->delete()
#6 /var/www/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(797): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldMethod('delete', Object(Drupal\node\Entity\Node))

Steps to reproduce

  1. Create a cron job that deletes nodes that have a calendar download field.
  2. Run the cron job via drush. See this error in logs.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States maskedjellybean Portland, OR

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024