Closed (fixed)
Project:
Classified Ads
Version:
5.x-1.5-8
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2008 at 00:39 UTC
Updated:
20 Mar 2008 at 17:51 UTC
Problem:
If you using PHP4 with classified ads created CCK views does not display the ad body.
Solution:
In module code line: 1159.
function ed_classified_view($node, $teaser = FALSE, $page = FALSE) {
proper argument list would be:
function ed_classified_view(&$node, $teaser = FALSE, $page = FALSE) {
($node called by reference, because $node is modified inside this function)
It tooks me one and half hour to figure out what's going on, plz submit a patch.
Comments
Comment #1
mcurry commentedI'm not sure why this is necessary, because I've not tested it with CCK. I thought I was following the Views documentation at the time the views integration was added, so perhaps I missed something. Ah well, live and learn.
I've committed the minor change. Please download and test the next -dev nightly build and let me know if this behaves as expected, and if so, I'll roll an official release.
Comment #2
attb2 commentedThanks! I'm tested it with PHP 4.4.10 and Drupal 5.5, and works!
You have right, this site http://api.drupal.org/api/function/hook_view/5 does not mention $node as "pass by reference" argument.
Comment #3
mcurry commentedYeah, the new $node value is returned, so I'm not sure why the parameter needs to be passed by reference in order for it to work with CCK views. Is this due to a bug in CCK Views?
I don't have time to dig in to this, though.
Anyway, good luck!
Comment #4
attb2 commentedI've submitted a bug report to Views too, but no reply. :-o
http://drupal.org/node/226172
Comment #5
csc4 commentedI think this might cause errors under PHP 5 as call by reference has been deprecated and other modules are patching to _remove_call by reference (including CCk itself in the past http://drupal.org/node/81599
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.