Error when using service in nested paragraphs

Created on 8 July 2022, over 2 years ago
Updated 23 July 2024, 4 months ago

Problem/Motivation

I'm using node_read_time.reading_time service in my custom module. When I try to add paragraphs and save. It thows an error like a the ones below. It was working totally fine until, I upgraded Drupal core to 9.4.1


The website encountered an unexpected error. Please try again later.
AssertionError: Cannot load the "paragraph" entity with NULL ID. in assert() (line 295 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

assert(, 'Cannot load the "paragraph" entity with NULL ID.') (Line: 295)
Drupal\Core\Entity\EntityStorageBase->load(NULL) (Line: 167)
Drupal\corp_api\Calculate\ReadTime->collectWords(Object) (Line: 37)

Looking at the bit more in detail, I've found that issue is coming from line 165 of ReadingTime.php file. It might not be issue with module but as I metioned it works fine on Drupal 9.3.16

Any idea or suggestions?

🐛 Bug report
Status

Closed: outdated

Version

1.6

Component

Code

Created by

🇬🇧United Kingdom drs2034

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024