drupal_render() does not contain all content from multiple viewfields
sphopkins - September 4, 2009 - 13:34
| Project: | Viewfield |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Darren Oh |
| Status: | active |
Jump to:
Description
Noticing this on my site. Any part of a node that is retrieved by a view using tokens for arguments does not load any of the views for display / printing / emailing. I have noticed this reported in the following issue #388096: It won´t print anything that I bring from other nodes (content_profile_load) but in my case it does not occur because of Organic Groups.

#1
Can you provide a recipe to setup one of those nodes?
#2
Sure. Using CCK, ViewField, Token and Views modules.
I have two different node types - call it X and Y
Create a CCK X content type. Ensure that there is some CCK fields to display in the view.
Add some data to a new node of the content type X. Make the title 12345678 (mainly for demo purposes but any token enabled field is usable).
Create a View on that content type. Add some fields from that content type, filter based on the CCK content type X, and ensure that there is an argument for Node: Title.
Create a CCK Y content type. Create several CCK fields as a ViewField. Set the viewfields up to use the view that was just created. Ensure that the token replacement is [title].
Create a node of content type Y with a title of 12345678.
When you view the new node of content type Y you just created you should see the viewfields with the content of the node of content type X.
Pretty sure that this sounds correct from what I have done. In the end the node is structured like this for me:
NODE(X)
[title]
Fieldset A
<li>CCK Content type (date)
<li>CCK Content type (text)
<li>ViewField1 - View(a)
Fieldset B
<li>ViewField2 - View(b)
<li>ViewField3 - View(c)
<li>ViewField4 - View(d)
...
Fieldset C
...
And this displays properly as a node. When I click on the printer friendly icon all I get is the following node content:
[title]Fieldset A
<li>CCK Content type (date)
<li>CCK Content type (text)
<li>ViewField1 - View(a)
The rest of the content is not displayed.
Doing some troubleshooting I find that if I arrange the node like this:
NODE(X)
[title]
Fieldset A
<li>CCK Content type (date)
<li>CCK Content type (text)
<li>ViewField1 - View(a)
<li>ViewField2 - View(b)
Fieldset B
<li>ViewField3 - View(c)
<li>ViewField4 - View(d)
...
Fieldset C
...
Then viewfield2 appears on the printer friendly page.
Hope that makes sense.
Thanks
#3
Note that I have other content inside fieldsets in a CCK content type that is not a viewfield and all displays properly
e.g.:
NODE(X)
[title]
Fieldset A
<li>CCK Content type (date)
<li>CCK Content type (text)
Fieldset B
<li>CCK Content type (date)
<li>CCK Content type (text)
...
Fieldset C
<li>CCK Content type (date)
<li>CCK Content type (text)
...
#4
#5
Subscribing
#6
Hi,
I've discovered that drupal_render() only returns a partial set of the configured fields.. I don't understand why that happens, but that's the reason why you're seeing this behavior in the print module.
I am moving this to the viewfield module, as I believe that module's responsible for the display of the viewfields.
João
#7
Many thanks for looking into this.
I am hopeful of an eventual fix - I am willing to test as needed.
#8
I am unsure who within viewfield will be looking at this, and I am unsure what constitutes a critical bug, but this is very important and critical to me ;-)
Please contact me if I can test anything out.
#9