When we have following field structure like given below
Node
|- Paragraph field
|-- Paragraph field
|--- Some field like link etc.
Where, one paragraph embedded into another and display is patternbuilder formatter display at that time, if we want to alter some field of inner paragraph, we can't hook into entity view, because inner field is referenced by entity reference and assembled by paragraph.
So there is no way to hook into field.
Propose solution will create one hook and allow to hook into entity and modify fields accordingly.
Comments
Comment #2
mohit_aghera commentedComment #3
mohit_aghera commentedComment #4
mohit_aghera commentedUpdating initial patch.
Comment #5
mohit_aghera commentedComment #6
hussainwebShouldn't this be hook_patternbuilder_entity_prepare_alter?
Comment #7
mohit_aghera commentedThank you @hussainweb for quick review and all the support.
Comment #8
mohit_aghera commentedFixing code formatting issue.
Comment #9
hussainwebI don't think this is a blocker but the comments could be improved. Also, the invocation of drupal_alter could use a comment to explain the intention of firing a alter hook briefly.
Comment #10
mohit_aghera commentedComment #11
hussainwebWhile we go ahead with this, to me, it seems like a quick fix. It would be quite valuable to figure out a built-in Drupal hook when rendering fields as property maps as well.
Comment #12
siwinski commentedComment #13
siwinski commented