AssertionError: Cannot load the "node" entity with NULL ID. in assert()

Created on 4 June 2021, about 3 years ago

Problem/Motivation

This error is thrown when I'm trying to clone a paragraph using Clone option from contextual links.

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

After investigating the error cause I found that when the user opens media modal form, paragraphs edit clone form is rebuilt using media context and current form context containing data for cloning is lost.

Steps to reproduce

- clone a paragraph entity with a media field
- fill all information required for cloning
- upload an image via media library
- saving the form will throw the error

Proposed resolution

Since FormState values are lost, I propose the solution to retrieve lost data from UserInput state, this will allow ParagraphCloneForm to finish cloning process.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡²πŸ‡©Moldova sdstyles

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.69.0 2024