Drupal - 6.5
NodeReferrer - 6.x-1.x-dev
CCK - 6.x-2.1
Views - 6.x-2.1

This module has really become one of the most important part of my Drupal site. It's awesome, but there are some errors.

I have created 3 content types, a parent, child and grandchild. I sometimes get errors like this:
# warning: Invalid argument supplied for foreach() in /home/sites/konsultblog.com/public_html/sites/all/modules/nodereferrer/nodereferrer.module on line 251.

What is wrong and how can I fix this.

Comments

wrb123’s picture

I am having this same error message appear when creating a parent/top item in the hierarchy. It does not seem to affect anything, yet is annoying because it appears to users :/ (drupal 6.6)
This is a great module and I would love a patch for this.

wrb123’s picture

P.S. - this is also happening after middle/child node creation, but does not seem to ever happen during bottom/grandchild node creation.

wrb123’s picture

P.S. - this is also happening after middle/child node creation, but does not seem to ever happen during bottom/grandchild node creation.

jaxpax’s picture

That's right, the same for me. I was a little to vague in my explanation. To be more specific: I'm using Node Referrer and want to use a drag n drop feature that comes with that module. What I want to do is to sort my nodes, in a View, in a specific order, only using the node title, and when I hit the save button the error pops up. I also have a different View with the same nodes but this View contains both title and body text, in the order specified in the previously explained View. The strange thing here is that the View present the nodes, but without any errors.

Flying Drupalist’s picture

subscribe

damienmckenna’s picture

After coming across this myself in 6.x, I suggest doing some testing to ensure the node variable being passed in is a complete node and not NULL; my error stemmed from a typo, once I fixed the typo it worked again.

andypost’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

I see that related to 6.x branch not 5

So is this still an issue?

jcfiala’s picture

I'm getting an error while running cron at line 451 in 6.x-beta2.

$type = content_type($node->type);
foreach ($type['fields'] as $field)...

Could it be some node types doesn't have a 'fields' array attached to it because it has no cck fields yet?

andypost’s picture

@jcfiala Error or warning? if no fileds attached then empty array is returned, so I see no problem with this code. Could you explain what cck version are you using?

Goofy2k’s picture

subscribe

larskleiner’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.59 KB

I get the following warning message when submitting an opencalais form (which doesn't use cck).

warning: Invalid argument supplied for foreach() in nodereferrer/nodereferrer.module at line 466.

I believe this is the same warning jcfiala is talking about in #8. Attached a patch that fixes this particular warning message. I couldn't reproduce the OP's warning message and I'm pretty sure this patch wouldn't do anything to fix that one.

andypost’s picture

Status: Needs review » Fixed

Thanx for patch, commited http://drupal.org/cvs?commit=410172

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.