Closed (fixed)
Project:
Node Family
Version:
master
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2006 at 12:11 UTC
Updated:
17 Sep 2006 at 14:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
fagoah thanks.
does the attached patch fix the problem for you?
Comment #2
gmak commentedYes, and no. It fixes the error on line 481. But throws the same error at line 508:
Fatal error: Only variables can be passed by reference in /path to my site/modules/nodefamily/nodefamily.module on line 508This happens even though I see that your patch has changed the code at line 508.
Comment #3
fagoAre you sure, that you have applied the patch correctly?
The code on line 481 is exactly the same as the code on line 508, so there can't be any difference.
Have you tried nodefamily_relation_load_by_type() and nodefamily_relation_load() or only one of them?
Comment #4
gmak commentedOkay, I've figured something out. It seems that the problem is in this code from the examples:
$children = nodefamily_relation_load_by_type($nid);or
$children = nodefamily_relation_load($nid);If I have this in a template, it throws the errors. If I don't use a template it does not throw any errors and displays the correct information.
Just to make clear, I'm using nodefamily, usernode and nodeprofile. I have created a CCK type called 'content-personal_information' and associated this with usernode. I create content for the 'content-personal_information' and then follow the link from 'my account' page to the node which corresponds to the usernode. that's when the error appears.
Comment #5
fagoyeah, this code is only in this functions. so the above fix fails too.
please try this one, it should work now. however it's strange, because I'm using php5 too (php 5.1.6)
Comment #6
gmak commentedWell, there is some improvement (I think), but I'm still not seeing what I should.
if in my template I use
$children = nodefamily_relation_load_by_type($nid);I don't get any errors but I also don't get any output - just a blank content areaif I use
$children = nodefamily_relation_load($nid);it throws the error at line 483.Also, the patch did not seem to apply properly but didn't give any fail notifications. So, I fixed it by hand. I attach it here so you can check to see if maybe something didn't get done properly.
Thanks for your help with this. I hope we can find a solution soon.
Comment #7
fagoyour patched module looks fine.
the function call loads only the related nodes, to output them you have to do something like that:
Comment #8
gmak commentedThat's exactly what I'm doing. Here is my template file:
This results in a page with no content.
If I change it to this:
I get simply "n/a" appearing in the content area.
If I do not use my template file, and let drupal simply render the CCK through the normal node.tpl.php, I see what I should in the content area.
It seems to mee that the
$children = nodefamily_relation_load_by_type($nid);is not getting the correct return for some reason.Comment #9
fagoprobably there aren't any children.
have you set up any relations for your content type? you can check wheter nodefamily has created a relation in the "nodefamily" table with phpmyadmin or so..
Comment #10
gmak commentedThere are children. See the attached jpg from phpMyAdmin. I just opened these individually in my browser and they correspond to the two pages that are associated with my username. You can check these at http://www.baade.org/node/236, and then follow on to node/394.
I'm going to try setting things up for another user and see what happens.
Comment #11
gmak commentedOK, just tried it with a different user and the same results.
The nodefamily table is updated with the relevant fields.
The output on the template page is exactly the same; either "n/a" or no output.
Very odd.
Comment #12
fagohm, yeah node 394 is child of the usernode 236. but are there any childs of node 394? probably not, so there is nothing to display.
you could theme the usernode to display the content of node 394 inside the usernode instead of showing a link.
Comment #13
gmak commentedahhh, now that makes some sense. Maybe this isn't as clear as it could be in the documentation or a more expanded tutorial/how-to would help.
Thanks for your help. I'll let you know how I get on.
Comment #14
gmak commentedStill having problems.
I have now created another CCK type ('content-course_information'). I have created a nodefamily relation between this CCK type and the other CCK type. So, I now have nodefamily relationships that look like:
Usernode > content-personal_information
content-personal_information > content-course_information
If I'm not mistaken this should mean that when I look at the output from my template (for content-personal_information), which includes:
I should the data from both content types. But, I'm seeing the output for the personal_information type (which is being pulled in directly to the template), but I am not seeing the 'child' content (course_information).
Looking in the database I see that the relations are there.
Again, using
nodefamily_relation_loadthrows an error (line 483). While usingnodefamily_relation_load_by_typeresults in no output.Comment #15
fagoah, change your line 483, so that the few lines look like this:
The nodefamily_relation_load_by_type() function generates different arrays, so you would have to change your output code to:
for this function.
Comment #16
fagoahm of course it has to be
foreach ($children as $type => $nodes) {
foreach ($nodes as $childnode) {
print node_view($childnode);
}
}
Comment #17
fagoCommited to HEAD.
So you can also check out the latest nodefamily.module.
Comment #18
(not verified) commented