this works for me:
<?php $children = nodefamily_relation_load($nid); ?>
<?php
foreach ($children as $childnode) {
print node_view($childnode);
this does not, and produces the following warnings:
<?php $children = nodefamily_relation_load_by_type($nid); ?>
<?php
foreach ($children as $childnode) {
print node_view($childnode);
warnings:
warning: Invalid argument supplied for foreach() in C:\home\user\public_html\drupal\modules\node\node.module on line 504.
warning: implode() [function.implode]: Bad arguments. in C:\home\user\public_html\drupal\modules\node\node.module on line 508.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in C:\home\user\public_html\drupal\includes\database.mysql.inc on line 172.
warning: Invalid argument supplied for foreach() in C:\home\user\public_html\drupal\themes\jolly\node.tpl.php on line 31.
I am doing something wrong, or is this some kind of bug?
thanks,
abramo
Comments
Comment #1
fagono you are using the function wrong. have a look at it to see how the array is built or print it yourself by using print_r or dprint_r
Comment #2
abramo commented@fago - many thanks for the clarification.
by merely replying to my query you are already giving me something, while you really owe me nothing - therefore my appreciation is for granted, no two ways about it.
however, there is an element of sadness in this:
your response assumes that I am a php programmer,
and if I am not, well, pity : I should have been, if I want to use this function.
so, if anybody kind enough finds the time just to tell me what I have to change in the above code to make it work, because I have not got the faintest?
thanks,
abramo
thanks,
abramo
Comment #3
abramo commentedComment #4
abramo commentedComment #5
fagohave a look at this issue:
http://drupal.org/node/87760
Comment #6
abramo commented@fago : great : many thanks - this covers me completely :)
strange : this post did not come up when I did a search of past issues - maybe I have to learn to use Drupal search a bit better . . . .
I have a suggestion to make:
perhaps this code example
should go into the README for the module - it would save everybody a lot of unnecessary trouble.
thanks again,
abramo
Comment #7
fagoyep, I agree this should be improved!
Comment #8
fagodone & committed to all stable branches.
Comment #9
abramo commentedgreat :)
Comment #10
(not verified) commented