Download & Extend

drupal_render() does not contain all content from multiple viewfields

Project:Viewfield
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Darren Oh
Status:closed (fixed)

Issue Summary

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.

Comments

#1

Status:active» postponed (maintainer needs more info)

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

Status:postponed (maintainer needs more info)» active

#5

Subscribing

#6

Title:Printer Friendly version does not load content from other nodes that are referenced via a view / tokens» drupal_render() does not contain all content from multiple viewfields
Project:Printer, e-mail and PDF versions» Viewfield
Version:6.x-1.8» 6.x-1.x-dev

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

Assigned to:Anonymous» Darren Oh

#10

Status:active» fixed

Fixed in CVS commit 295544.

#11

Status:fixed» needs review

Fix caused problem in normal node view. Here's a patch that seems to work in all cases. I'd like to know why token replacement can have this effect before making committing a change.

#12

Forgot to attach patch.

AttachmentSize
viewfield.theme_.inc-568304-10.patch 817 bytes

#13

Wrong patch.

AttachmentSize
viewfield.theme_.inc-568304-12.patch 927 bytes

#14

That patch looks like it works for both the normal node and the printer-friendly version.

#15

Status:needs review» fixed

Fixed in CVS commit 297100.

#16

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here