I had several nodes with an optional taxonomy vocabulary, a few of which had no selection from that vocabulary. I later made the vocabulary required, and I then got errors that are probably because of this.

This error usually, not always, showed up after a cron run: Invalid argument supplied for foreach() ... taxonomy.module on line 1214

Additionally--and this is where it gets really weird--is that I have a rule, through the Rules module, that sends an email when a node is changed. Any time the error happened, about 100 or so emails are sent out due to these note changes.

Even more strangely, I have the Diff module running, and I can use it to see that the latest revision on a good sample of these many nodes indeed shows the most recent revision being the same time as the cron run!

So when these noncompliant nodes are discovered, Drupal tries to alter them?

Adding a taxonomy term to the few nodes without the required taxonomy term seems to have cleared up the issue, although it's so sporadic that it may be a few errorless weeks before I am sure it's fixed.

Comments

aren cambre’s picture

Title: Converting taxonomy vocabulary to required causes PHP errors and node writes » Converting taxonomy vocabulary to required causes PHP errors
Status: Active » Closed (works as designed)

This issue is hopelessly compromised--the writes are because of my own code embedded in a page. Apparently PHP gets executed each time the search engine indexes the page. I will open a separate issue about the rest of this.

Moved to #692764: Converting taxonomy vocabulary to required can cause PHP errors in watchdog.