How to get parent of C, if A > B > C or A > C

Created on 20 December 2023, 6 months ago

I have a situation, where a custom entity type C can be embedded with Inline Entity Form as in A > B > C, but also A > C. I've implemented a custom inline_form handler (that inherits form \Drupal\inline_entity_form\Form\EntityInlineForm).

How can I get the parent of C, assuming it can be either B or A, for example in EntityInlineForm::entityForm()? I know about getting a form object from $form_state, but it's always a root (A), and what I want is an immediate parent.

Would appreciate any help!

πŸ’¬ Support request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡΅πŸ‡±Poland adr_p

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024