I'm using IEF Multiple widget. I set up a View to provide nodes for the entity reference field.

I get a list of node types in the 'add new node' to choose from. So what type of node I' want to create. This list contains two elements: the one the user must create (no other options) and the node type whoch is the current one (which form I use at the moment.)

Other words: U have an event type and venue_a type and venue_b. I use entity reference to venue_a or venue_b. I use a views to supply the nids. When I'm editing event I see the reference field with an 'add new node' option with a select list with two options: event and venue_b. I presume venue_a and venue_b should be there. Well in my case actually I want to hide venue_b: I want only venue_a to be created (besides venue_a and venue_b are on my View).

My Workaround doesn't work:
As a quick workarround I tried to unset the incorrect node types with hook_form_alter. I gave commmand

unset ($form_state['field_event_venue']['und']['actions']['bundle']['#options']['event'])

which didn't unset the unwanted item. It might be a module wight issue. Have no idea yet.

Any idea how to do a quick workaround before a patch?
(I need my view for node search field. Also I need that user doesn't see any options as no need for overwhelming her. So I cna't change these things)

CommentFileSizeAuthor
#1 Screen shot 2013-04-02 at 01.49.49.png22.94 KBbsandor

Comments

bsandor’s picture

StatusFileSize
new22.94 KB

I attache a screenshot.

Any idea how to hide an element in (to have one only) is appreciated.

bsandor’s picture

My idea at this moment is that the list of 'what bundle the user can choose from in case of 'adding new node' ' Should be the same list as in 'Simple(optional filter bundle)' mode.

I think there's no direct connection between selecting and creating node types. (maybe user can choose from type A or B and should be able to create from B or C...)

So actually the best might be list with all the bundles in both 'Allow users to add existing nodes.' and 'Entity selection mode'. They are not related at all.

bsandor’s picture

I opened this http://drupal.org/node/1958434 issue for the described thing.

bojanz’s picture

Status: Active » Closed (duplicate)

Sounds like a duplicate of #1872316: Can't select a default bundle when using entity reference views which has the first patch to take into account the bundles allowed by the view.