Problem/Motivation

When saving, on unpublished nodes, it throws a fatal error: Unable to save a paragraph without a valid reference to a host entity.

Proposed resolution

See Patch.

Remaining tasks

Review patch.

User interface changes

None

API changes

None

Data model changes

None

Comments

tomhollevoet created an issue. See original summary.

dafeder’s picture

I have a script that creates paragraphs to be added to a field in another paragraph, and was getting this error occasionally for reasons I still don't understand. FWIW this patch seems to have fixed, though admittedly I don't understand all the implications it could have.

silverham’s picture

I have same with my scripts in update hook as well. I have tested this in it works. I don't think there would be case where a user wouldn't have access to paragraph parent, especially in code.

silverham’s picture

Status: Needs review » Reviewed & tested by the community
danyg’s picture

Thanks, it a good patch, it helped me. I've updated paragraph items in update hooks and drush wasn't able update the unpublished nodes. But with this patch it works like a charm. Thanks again.

jstoller’s picture

Status: Reviewed & tested by the community » Needs review

Can someone please test to see if this patch is still necessary, given all the recent commits to dev. And if it is, please re-roll against the latest dev.

coffeduong’s picture

@jstoller I've tested the above patch and it worked correctly. Please deploy it on the next release. Thank you!

jstoller’s picture

Status: Needs review » Postponed (maintainer needs more info)

The patch does not apply to 7.x-1.x-dev.

Please test the latest 7.x-1.x-dev release and confirm that you are still able to reproduce this issue, as there have been many changes to the way host entities are handled in Paragraphs. If it is still a problem, then please re-roll the patch so it applies to dev and confirm it fixes the issue.

bluegeek9’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
//www.flaticon.com/free-icons/thank-you Thank you for your contribution!

Unfortunately, Drupal 7 is End of Life and no longer supported. We strongly encourage you to upgrade to a supported version of Drupal.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.