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.
This is new for beta2: the View selected for the Nodereference Explorer widget must have a "Node: Nid" field, and it can't have "Exclude from display" checked. Otherwise the nid doesn't get passed to the Node Reference field and you get values like this:
Node Title [nid:]
which will get a "no valid post found" error when you try to submit.
Comment | File | Size | Author |
---|---|---|---|
#11 | nodereference_explorer_optimize_js_css_20091109_gnindl_2.patch | 2.96 KB | gnindl |
#10 | nodereference_explorer_optimize_js_css_20091109_gnindl.patch | 2.59 KB | gnindl |
Comments
Comment #1
vood002 CreditAttribution: vood002 commentedThanks for posting this, I didnt see this covered in any documentation and without it no worky.
Comment #2
beauz CreditAttribution: beauz commentedYep I can confirm this problem, hopefully see a fix soon.
Comment #3
gnindl CreditAttribution: gnindl commentedNode id can now be excluded from the display but it has to be provided as a view field. When the Node id is not included in the display the node id will be retrieved from the view result.
Comment #4
gnindl CreditAttribution: gnindl commentedCheck out the current development snapshot for testing.
Comment #5
gnindl CreditAttribution: gnindl commentedComment #7
Les LimThe statement in #3 is correct for Table and Grid views. In List view, however, excluding the NID from display still prevents the autocomplete field from receiving the NID.
Comment #8
rjbrown99 CreditAttribution: rjbrown99 commentedI also have a small issue with this.
Scenario #1:
1) A 'default' view with basic settings that mirror the nodereference_explorer_default view, with the Style: Table (Selectable). The Node: NID field is excluded from the display.
2) A 'Grid' view with basic settings that mirror the nodereference_explorer_default view, with the Style: Grid, and Row Style: Fields (Selectable). The Node: NID field is excluded from the display.
This works as you might think, and allows you to properly select your fields/items. It returns the correct [nid:123] into the autocomplete box.
Scenario #2:
1) A 'default' view with basic settings of Style: Grid, and Row Style: Fields (Selectable). The Node: NID is excluded from the display.
2) A 'Grid' view with basic settings of Style: Grid, and Row Style: Fields (Selectable). The Node: NID is excluded from the display.
In this case, it does not return the correct autocomplete - you just get [nid:] returned. If you change the Node:NID field in this scenario to not be excluded, the [nid:123] is correctly populated.
What I am getting at is if your view 'Defaults' is set to Grid and your Node:NID is excluded from display, the [nid:123] is not returned correctly to the autocomplete box.
Comment #9
abaddon CreditAttribution: abaddon commentedthe title field cant be hidden either, some might want this to create another "title" field from several CCK fields, this fixes it
Comment #10
gnindl CreditAttribution: gnindl commentedThe $vars['row'] variable in the field (selectable) preprocess function has information about ALL fields, including the excluded from display.
The patch from #9 is here included as well.
Comment #11
gnindl CreditAttribution: gnindl commentedSorry guys patch from #10 is buggy, got the condtionals wrong. Patch #10 should be considered as obsolete.
Here is the right one for solving #10.