Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mansspams’s picture

Views or VBO widget would be ultracool.

bojanz’s picture

The existing entityreference integration should allow the "Reference existing" autocomplete to pull results from a view.

That's as far as IEF 1.x will be able to go.
After #1881616: Move the inline forms (add, edit, remove, reference existing) to modals is implemented, we might be able to go further, but in general using a View as a selection widget requires huge hacks and the resulting bugs are usually not worth it.

Summit’s picture

Hi, coming from http://drupal.org/node/1944266

Would love to be able to filter on producttype, because I have different producttypes which needs to be handled by different product displays (nodes).
Right now all products are shown on "existing variants" and they are only possible to select using autocomplete widget. These are much to much products sometimes for a producttype which sometimes only has 20 relevant productvariants.

Thanks a lot in advance for considering getting this in.
greetings, Martijn

Summit’s picture

Hi,

For your remark http://drupal.org/node/1558120 on which you are referring to "which for entityreference fields should allow fetching from the results of a view as well, but I haven't tested that yet"; made a new issue: http://drupal.org/node/1966738

greetings,
Martijn

dww’s picture

Priority: Minor » Normal

I was assuming there was a way to configure this to just enhance the existing entity_reference widget (whatever it might be) to inject a "add new" next to what's there. In my case, the content creators aren't already going to know if they can reference existing or need to add new. In some cases, they just want the dropdown of existing values. In others, they need to see and try the autocomplete first. Only if they don't see what they're adding would they want to click a button and wait for the ajax reload to replace the form element.

Also, if you set the widget to a IEF - single value it *always* embeds the inline add form and doesn't let you select an existing at all, making the 'Allow users to add existing nodes.' widget setting checkbox (and the related settings that are revealed if you check it) meaningless. ;)

#1881616: Move the inline forms (add, edit, remove, reference existing) to modals won't really help this (and in some ways would make it worse). I just want to see the selection widget I've already got when the form first load, and if I need to add a new entity, click a button for a modal or ajax inline rebuild. I haven't dove into the code yet to understand why this would be so hard. But, I might be willing to spend some effort making it happen since my itch is itchy these days. ;) Any advice or pointers would be appreciated.

Based on a quick search of the IEF issue queue, this seems like the right issue to be discussing this in, but if not, please point me to a better one.

Thanks!
-Derek

bunthorne’s picture

I agree with Derek's assumption that most Content creators will not know whether their Term already exists. They should be able to begin typing the term (if using something like Chosen jQuery) for the select list; when it comes up blank, they would continue typing the complete name which would open the new Add form fields with the typed name in the Title field.

Is this on the drawing board? I don't think I can implement IEF until it is, as nice as it is.

bojanz’s picture

No, I have no time for work of that scale at the moment. Patches welcome.

bojanz’s picture

Issue summary: View changes

added "Add ability to select multiple variants, if selected."

bendiy’s picture

lucyp’s picture

Issue summary: View changes

Any progress on this?

I'd love to have the choice to use a different widget (not just the autocomplete) for selecting existing entities.

Unfortunately I wasn't yet able to understand the mega-patch submitted by bendiy (referenced above) as it deals with a number of different issues.

AaronBauman’s picture

Assigned: Unassigned » AaronBauman

Looks like this feature dropped out of the patch in #2134035
I'll attempt to isolate that functionality and re-roll here.

AaronBauman’s picture

Assigned: AaronBauman » Unassigned

nevermind.
That patch is a beast.
I will stick to a form_alter for my needs.
Sorry.

milos.kroulik’s picture

#11 Can you post an example of your hook, please? It looks like others also need something like this.

Syndz’s picture

This patch gives the choice between autocomplete and dropdown

brunodbo’s picture

Status: Active » Needs review
Syndz’s picture

This is the same patch as #13, but using Drupal coding standards.

Status: Needs review » Needs work

The last submitted patch, 15: inline_entity_form-existing_entities_widget-1807120-13.patch, failed testing.

Syndz’s picture

Status: Needs work » Needs review
FileSize
25.84 KB

Bugfix for #13, correct target bundles

Status: Needs review » Needs work

The last submitted patch, 17: inline_entity_form-existing_entities-widget-1807120-15.patch, failed testing.

Syndz’s picture

junaidpv’s picture

Rerolled patch as #19 does not apply cleanly.

junaidpv’s picture

Improved to use entity selection handle to provide the entities to show in drop down. So, it will work with view selection mode too.

junaidpv’s picture

Status: Needs work » Needs review

The last submitted patch, 19: inline_entity_form-existing_entities-widget-1807120-19.patch, failed testing.

The last submitted patch, 20: inline_entity_form-existing_entities-widget-1807120-20.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 21: inline_entity_form-existing_entities-widget-1807120-21.patch, failed testing.

dww’s picture

Heh, here I am 10+ years later. Found this while searching, forgot I had been here. This is partly being solved at #2683125: Allow select widget for "Add existing items".

geek-merlin’s picture

Version: 7.x-1.x-dev » 3.x-dev

Yah, we have a lot of zombies down the well.
If this is still relevant (otherwise close) this goes to 3.x as main development branch.