Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.5
Component:
Documentation
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2007 at 23:29 UTC
Updated:
2 Aug 2007 at 05:27 UTC
The sample template.tpl.php included with CCK has callback code that, when used in PHPTemplate, generates a host of php "Invalid argument supplied for foreach()" warnings when phptemplate_field() and field.tpl.php gets copied to a custom template file.
The code reference is at the bottom of the function:
return _phptemplate_callback('field_devices', $variables, 'field-'. $field['field_name']);
The reference as written causes phptemplate.engine, function _phptemplate_default() to generate PHP errors because it expects the third parameter ($suggestions) to be an array -- and the callback is passing a scalar.
Converting the Suggestion reference to pass an array resolves those warnings:
return _phptemplate_callback('field_devices', $variables, array('field-'. $field['field_name']));
-juanfe
Comments
Comment #1
yched commentedI don't know what is the version you're looking, but CCK 5--1.5 does have
And tagging your issue with HEAD is probably not right (I _hope_ you're not using cck HEAD, it's D6 work-in-progrees code)
Comment #2
juanfe commentedThanks!
Comment #3
(not verified) commented