Problem/Motivation

Errors occur (somewhat randomly) when using default content deploy with layout paragraphs.

[error]  Error: Call to a member function uuid() on null in layout_paragraphs_paragraph_presave() (line 120 of /app/web/modules/contrib/layout_paragraphs/layout_paragraphs.module) #0 [internal function]: layout_paragraphs_paragraph_presave(Object(Drupal\paragraphs\Entity\Paragraph))
#1 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('layout_paragrap...', Array)

Issue is that there is not a check if the paragraph still exists. Which could be a real use case (without default content deploy) if some situation occurs that a paragraph entity is deleted, while a (layout) paragraph still has a relation to it.

Steps to reproduce

Quite difficult. But I guess setting op a layout paragraph with some paragraph (3 of them or so), delete 2 of them programmatically, and save the left over one programmatically.

Proposed resolution

Simple check in the isset to verify that it is an object.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jefuri created an issue. See original summary.

jefuri’s picture

Status: Active » Needs review

  • jefuri committed 2d00fd2 on 1.0.x
    Issue #3195152: Errors using default content deploy on...
justin2pin’s picture

Status: Needs review » Fixed

Good catch, thanks @jefuri - this is merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.