Neither [nid] nor %nid passed correctly as arguments
| Project: | Viewfield |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
With Views 6.x-2.2.
I have a view 'attachments_node' that takes a node id as argument.
I've tested the view using direct calling from a template:
<?php
$viewName = 'attachments_node';
$display_id = 'default';
$arg = $nid;
print views_embed_view($viewName, $display_id, $arg);
?>Problem with this approach is that it places it below other $content.
And I've also tested it with View Reference (which however does not offer token replacement with [nid] or a %nid option).
I can't get it to work with View Field.
When I have the following settings nothing shows at all:
Book page settings:
[y/n] Force default (makes no difference)
Default value
[nid] (This vanishes on save !)
Global settings:
[y] Required
Number of values: 1
Allowed views: attachments_node
[y/n] Use a common default value for all nodes ... (makes no difference)
[y] Enable token replacements
(attachments_node_ arguments: [nid]If I turn off both Enable token replacements and Force default
then use argument %nid in the field settings, I still don't see anything in the served book node. And when I open up the field settings, once again %nid is gone.
If I then edit a book page and explicitly enter %nid as the argument to the view field, (or indeed the explicit node id as a number) it serves only the label !
I've tried every possible combination and permutation of the settings. There are a number of bugs.

#1
Bumping: this is a now long outstanding problem with a very precise bug report. Please help. Webel.
#2
Relates to: #386430: 'Use a common default value for all nodes..' not being applied automatically.
#3
Fixed using: 6.x-1.x-dev 2009-Dec-03.
Thanks for this successful update.
Please do in future take the time to indicate issues addressed by new releases.
Closing.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.