I ran cron manually.
I got this error 3 times in the log:
Invalid argument supplied for foreach() in /home/cancervo/public_html/drupal/modules/taxonomy/taxonomy.module on line 1189.

There are now 3 nodes missing.

Can I get back the content from the 3 nodes?
How to stop it happening and/or understand what is happening?

Taxonomy access control Lite installed, v 6.x-1.x-dev

Regards
Miriam

Comments

lucas.7bd’s picture

Hello!

I've got the same problem.

Additionally, I've got taxonomy manager module installed (6.x-1.0-beta2).

It seems that I have not lost any nodes...

Best regards
Lucas

eagereyes’s picture

How do you find out that you have lost nodes? I'm also getting this three times in every cron run, but where do I find information where that is coming from?

EagerEyes.org

tkcent’s picture

Its possibly a missing entry in the node_revisions table. I had this same problem and figured out that the revision specified in the node table did not have a corresponding entry in the node_revisions table.

Run this MySQL query to see if you have any orphaned nodes:

select nid,vid from node where (nid,vid) not in (select nid,vid from node_revisions);

If you have an orphan, check to see what the latest revision is on the node_revision table.

select max(vid) from node_revisions where nid = ?;

Replace the ? with the node number returned from the first query. Then you can update the node table with the latest revision.

WARNING: Backup database first before attempting to update the database directly. Use at your own risk!

update node set vid = ? where nid = ?;

SUPER ALL-IN-ONE MYSQL STATEMENT

For those who are brave enough, here is all the above code in one update statement (USE AT YOUR OWN RISK!). I have verified this works in MySQL v5.0.45.

update node a set vid = (select max(vid) from node_revisions where nid = a.nid) where (nid,vid) not in (select nid,vid from node_revisions);

I don't know if there is a better way to do this without modifying the database directly, but I hope it helps!

eagereyes’s picture

Thanks for the code! Looks like I don't have any orphaned nodes, great! But the error message is still there, any ideas where this could be coming from?

EagerEyes.org

brei9000’s picture

I did have an orphan, so I deleted it. I am still getting the error though. Has anyone had this problem too?

afterdark’s picture

After run the query above select nid,vid from node where (nid,vid) not in (select nid,vid from node_revisions);, i found out where the problem was, corrected it, and the error message disappeared. There was only one entry (in table node) that didn't have a match in node_revisions table, enough to trigger the error message.
And yes, tkcent, the method pointed by you seems to be the "better way" - for me at least, as i saw a lot of suggestions on this issue and all of them were drastic methods that involve hack/patch the core. Thanks a very lot!

beanworks’s picture

I ran cron manually.
I got this error 3 times in the log:
Invalid argument supplied for foreach() in /home/cancervo/public_html/drupal/modules/taxonomy/taxonomy.module on line 1189

The same thing happened to me. Lost three nodes. So I recreated the nodes, but am still getting the error (except that now the error is on line 1230, and doesn't appear until I hit the refresh button).

Any clues about what happened?

Little history: I added a page, with some menu links, but didn't publish it because I wanted to create taxonomy terms to add. When I went back a couple days later to finish the post, I ran cron first, and lost the 3 nodes.

Any help is greatly appreciated!

Thanks,
Carol

parrottvision’s picture

oh that worked a treat. I ran the sql code to search for orphaned nodes and I found 4. Couldn't find references to them in any other tables so I just deleted them and it worked a treat. No more taxonomy errors and cron is running smooth again.

thanks!

PS - The reason I had orphaned nodes was because I installed a module - ecommerce - created a couple of products and then uninstalled it, upgraded to 6 from 5, then the 'products' content type nodes were left without a home.

lilon’s picture

Hi,
I just moved my test site to a production site - both on the same server (hosting service using plesk). I copied all files to a new folder and copied the database to a new database as well. I only had to change the db name and credetials in setting.php.

Everything works well except this error message every cron run:

Invalid argument supplied for foreach() in /home/httpd/vhosts/mysite/httpdocs/modules/taxonomy/taxonomy.module on line 1189.

I ran the sql to look for orphans but the query returned 0 rows.

I ideas?

thanks

lilon’s picture

The error messages suddenly disappeared so it could have been either a cache thing or something to do with permissions (probably less likely - since I copied the whole folder structure, the ownership moved from apache to user and I could not use 755 anymore).

Hope this helps someone.

drfuzetto’s picture

I am also having this problem and don't have any orphan nodes.
Any other way of tracking down what is causing this error?

Deborah Fuzetto

jsimonis’s picture

We also have this error. It'll pop up, then go away.

I ran the sql statement and we have 0 orphaned nodes.

tronathan’s picture

We are seeing this error also. We have no "orphaned nodes". This is a relatively new site, but with a lot of modules present. Any info from the maintainer of taxonomy.module?

david-en8’s picture

It may help.