I have a node to be used in inline entity form, the node needs to be added with a query string like '?og_group_ref=22'.

So is it possible to add query string for the inline entity form?

CommentFileSizeAuthor
#2 1689554-1.patch1.24 KBrogical

Comments

rogical’s picture

Title: Support query string » Get query string parameters from parent form's URL -- ief_field_xxx=xxx&ief_field_xxxx=xxxx

I thin we can name the query string for inline-entity form with a prefix 'ief_', then pass them in to forms.

rogical’s picture

Title: Get query string parameters from parent form's URL -- ief_field_xxx=xxx&ief_field_xxxx=xxxx » Pass query parameters to ief - eg:field_xxx=xxx
Status: Active » Needs review
StatusFileSize
new1.24 KB

I made a patch, please review.

rogical’s picture

Title: Pass query parameters to ief - eg:field_xxx=xxx » Inherit query parameters to ief
generalconsensus’s picture

For my use case I have three fields that can be tested. I choose each time just to test one:

Region (United States, Canada, European Union) query: http://www.example.com/testproduct?field_region=15
Gift Product (No, Yes) http://www.example.com/testproduct?field_gift=1

In both cases it failed to populate the fields with the queries am I missing something?

rogical’s picture

Do you apply the patch successfully? This patch just pass all query strings to ief, I've already used in my site with entity reference prepopulate.

generalconsensus’s picture

I've been unable to bring up the prepopulate selection under the product reference field in my product display, which I am assuming is what you did originally.

Here are the steps I have done so far:
1. Installed Base Drupal Commerce (No Demo Store)
2. Patch Inline Entity Form with your patch
3. Install Entity Reference Prepopulate
4. Create a new Product Display to test the new Entity Reference Prepopulate functionality with
5. Add a Product Reference field with the Inline Entity Form
6. Problem. There is none of the 3 pre-populate selection fields that pop up in the entity reference field under the product reference field.
a. Is the problem due to the fact that the Entity Reference Pre-populate functionality is not patched to work with the Product Reference module?

Thanks!

rogical’s picture

this maybe the problem, I currently use ief just in nodes, not yet in commerce, do Need some work for commerce.

bojanz’s picture

Status: Needs review » Closed (won't fix)

This is something you can do from a contrib module using hook_inline_entity_form_entity_form_alter().
I don't want this in the module itself. Sorry!

rogical’s picture

A sandbox http://drupal.org/sandbox/rogical/1787828 IEF inherit parameters was created for this.

It should support both node and commerce, needs more testing.