Problem/Motivation

Attempting to delete a paragraph which no longer has a parent, for example using the batch cleanup provided by entity_reference_revisions module, leads to an error about calling getEntityType() on null in ParagraphPersistance::purge().

Steps to reproduce

Easiest way is to programmatically create a paragraph without a parent, save it, then try to delete it while the module is active.

Proposed resolution

Check if the parent exists before attempting to

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 meu_paragraphs.parent.3209030.2.patch1.23 KBtwod

Comments

TwoD created an issue. See original summary.

twod’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

Here's a simple patch to ignore parents which can't be loaded.

twod’s picture

Title: Paragraphs submodule assumes parent exists on delete » Paragraphs submodule assumes parent exists

  • bletch committed c95557ff on 8.x-2.x
    Paragraphs submodule assumes parent exists #3209030
    
bletch’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Needs review » Fixed
bletch’s picture

Status: Fixed » Closed (fixed)