Skip to content
Snippets Groups Projects
Commit e33ca877 authored by Justin Toupin's avatar Justin Toupin
Browse files

Explicitly set the parent for a new paragraph when it is appended to a Layout...

Explicitly set the parent for a new paragraph when it is appended to a Layout using the LayoutParagraphsLayout::appendComponent() method.
parent 5016be6c
No related branches found
No related tags found
No related merge requests found
......@@ -491,6 +491,7 @@ class LayoutParagraphsLayout implements ThirdPartySettingsInterface {
* @return $this
*/
public function appendComponent(ParagraphInterface $new_paragraph) {
$new_paragraph->setParentEntity($this->getEntity(), $this->getFieldName());
$this->paragraphsReferenceField->appendItem(['entity' => $new_paragraph]);
return $this;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment