Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I needed to save the parent entity directly when the entity in the dialog is created without requiring the user to execute the parent form.
Since the dialog is in an iframeit has no info on the parent context. Here's a patch that adds entity type, entity id and field name as query params to the add dialog.
This only adds the params to the add dialog. That was all I needed. It might be useful to add them to the edit dialog aswell. Or rethink the problem altogether. Anyhow, here's a patch that solved my problem.
Comment | File | Size | Author |
---|---|---|---|
#6 | references_dialog-parent_context_available_2149805_6.patch | 807 bytes | tombisho |
#1 | 2149805-make-parent-context-available-to-dialog.patch | 2.2 KB | emattias |
#5 | references_dialog-parent_context_available_2149805_4.patch | 743 bytes | tombisho |
Comments
Comment #1
emattias CreditAttribution: emattias commentedComment #2
emattias CreditAttribution: emattias commentedComment #3
emattias CreditAttribution: emattias commentedComment #4
tombisho CreditAttribution: tombisho commentedHi, this nearly helps me solve a similar problem. I need the parent node id to be available to be used in the context of a child node, but it doesn't get passed in the request.
Would anyone be able to help me do this?
Thanks
Comment #5
tombisho CreditAttribution: tombisho commentedThis patch meets my requirement
Comment #6
tombisho CreditAttribution: tombisho commentedFixed the warning message that comes up if nid doesn't exist
Comment #7
fluxline CreditAttribution: fluxline commentedpatch #1 patches with the current 7.x-1.0-beta1, but not against the dev.
For my testing, the patch did not work with solution I'm trying.
- using panels to add the referenced field using RD from the edit form onto the node itself. The edit link of an existing works and the changes are saved, i was hoping that this patch would allow the create link to work as well, the node is created but the parent with the NR field does not have the reference to the new child, even when using prepopulate