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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emattias’s picture

emattias’s picture

Issue summary: View changes
emattias’s picture

Issue summary: View changes
tombisho’s picture

Hi, 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

tombisho’s picture

This patch meets my requirement

tombisho’s picture

Fixed the warning message that comes up if nid doesn't exist

fluxline’s picture

patch #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