Problem/Motivation
For websites that use nested paragraphs, having the parent entity and id is not at all useful. It is typically just another Paragraph entity, and there is no way to see which node the paragraph belongs to.
This module would be way more useful if it had a link to the top-level Host entity instead of just the immediate Parent entity, which can often be a Paragraph entity if using nested paragraphs.
Proposed resolution
Since the top-level host entity cannot be obtained via a simple views query (because it would need to recurse up through the parents to find the host entity) the suggested approach is to create a custom views field and use PHP code to recurse through the parent entities via Paragraph::getParentEntity() until you find a non-Paragraph entity to which the item is attached.
Remaining tasks
User interface changes
In addition to listing the Parent entity type and id, we'll list the top-level Host entity and include a link to that entity, provided that the entity type has a canonical URI. Since Paragraph entities have no canonical URL, this often indicates the Paragraph may be orphaned which will be apparent from the unlinked Parent/Host entity title.
Issue fork paragraphs_admin-3406566
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
Comment #2
jwilson3Comment #3
jwilson3Comment #5
jwilson3Comment #6
jwilson3Comment #7
jwilson3Comment #8
nagy.balint commentedThanks!
It worked fine for me.
I think this would be a very good addition to the module.
Comment #9
chrisscrumping commentedPatch still works for 1.6 but will need updating for 1.x due to module file change.
Testing on a site and seems like a great adition to the module, would be good to get this merged
Comment #11
man-1982 commentedMade some changes and can confirm patch works well.
Thanks
Comment #13
vladimirausPHPcs is not working.
Comment #15
vladimirausComment #16
jannakha commentedphpcs is still red
Comment #17
vladimirausComment #18
jannakha commentedall green, thank you for your contributions!
please release!
Comment #19
vladimirausThank you all for your contributions. 🎂
Committed.
Comment #22
jwilson3Thanks for getting this in! 🎉