computed value does not get printed in view

bendev - November 8, 2009 - 20:25
Project:Computed Field
Version:6.x-1.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hello

The computed value does not get printed in views, the label is correctly printed but the value is empty.
If i remove the store in database, the value is correctly printed.
If i store in database, I can see the correct computed value in the database but it is not printed in views.

Thanks

#1

tpainton - November 8, 2009 - 22:23
Priority:normal» critical

I concur. I just installed Beta3 and tried the tutorial "Link a node to itself" and the $node.nid is not passed if "store in database" is checked. If unchecked, the value is passed to $display and works properly. I am going to change this to critical as it seems to a duplicated bug and breaks database storage, something needed to use the field in views.

#2

tpainton - November 8, 2009 - 22:27

Ah this might be user error. I should have an answer soon. debugging.

#3

tpainton - November 8, 2009 - 22:34
Priority:critical» normal

I don't think this is a bug. I think the problem is that you are viewing a node created before adding the field. I did this as well. If you are looking at a node created prior to installing, you must save the node to have the value passed. I am pretty sure this is by design. for some reason the following code doesn't retrieve the nodeid.

<?php
if (!$node->nid) node_save($node);
?>

Something with D6?

I don't know.. maybe I don't know what I am talking about, that a very good possibility but the bottom line is that it works just fine on old nodes of one simply edits, then saves the node. It also works fine with database storage on all newly created nodes.

Hopefully this helps someone.

#4

bendev - November 12, 2009 - 21:08

I don't understand your answer;
it doesn't help whether I add or remove the save node command.

 
 

Drupal is a registered trademark of Dries Buytaert.