This module doesn't give parent node of reference fields from
https://www.drupal.org/project/paragraphs
There are nested or recursive entities, that allow multiple levels of referenced entities in a field.

I checked that DependencyFieldMapGenerator service and return parent entities, but for Paragraph it will useful have parent node instead.

We could check if entity given is a paragraph and find parent node. I think to create a sub module for paragraphs that manage that.

entity_reference_integrity_paragraphs

Also create in root module an event, subscriber and dispatcher only for projects that have that sub module installed.

Comments

cgomezg created an issue. See original summary.

cgomezg’s picture

Title: Add support for nested Paragraph » Add support for nested Paragraphs
cgomezg’s picture

StatusFileSize
new1.57 KB

Added an Event and Dispatcher

Added sub module entity_reference_integrity_paragraphs with Event Subscriber

cgomezg’s picture

StatusFileSize
new7.14 KB

Here patch with sub module

cgomezg’s picture

Status: Active » Needs review
renrhaf’s picture

StatusFileSize
new6.84 KB
new10.89 KB

Modifying the patch to avoid loosing references when paragraphs are present.
Thus, we can consider other entity types than Nodes for the parent host entity.
The problem is that this patch is coupled with https://www.drupal.org/project/entity_reference_integrity/issues/3106920...

renrhaf’s picture

StatusFileSize
new9.2 KB
new13.02 KB

Oops forgot the Events code

The last submitted patch, 6: paragraphs-3106850-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

renrhaf’s picture

StatusFileSize
new16.89 KB

Uploading also the patch for both issues : this one and the links https://www.drupal.org/project/entity_reference_integrity/issues/3106920
for people who needs it.

renrhaf’s picture

Changing the patch because parent entities using paragraphs are still showing up in the dependencies, even if the paragraph reference was removed from the parent entity. This has to deal with https://www.drupal.org/project/paragraphs/issues/2920545

mrshowerman’s picture

StatusFileSize
new9.76 KB
new666 bytes

Adding support for D9.

mrshowerman’s picture

Version: 8.x-1.0-rc6 » 8.x-1.x-dev
StatusFileSize
new10.22 KB

Re-roll against current dev.

Status: Needs review » Needs work

The last submitted patch, 12: paragraphs-3106850-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mrshowerman’s picture

Status: Needs work » Needs review
StatusFileSize
new9.82 KB
ghost of drupal past’s picture

Related: Smartsheet has code which adds the root parent entity to paragraphs. We are interested in open sourcing this but would like co-maintainers. https://gist.github.com/chx/81a2bc111570e4476861b2d4124fa8c8 is it, needs to be turned into a separate module, some queries in the update are MySQL specific right now, the root link views plugin is crude and there's no tests.

Email karoly.negyesi@smartsheet.com if interested.