Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
how to reproduce it:
- create a vocabulary, non required, (either multiple or not), but no tags, let the <select> come up with a "none" option
- create a node, enter some term for that vocabulary
- edit the node, select the option "none", and request preview
warning: Invalid argument supplied for foreach() in /.../modules/taxonomy/taxonomy.module on line 70.
the problem comes when node_form_build_preview
build a faked node from $form_state['values']
which ends up in taxonomy module looking for an empty string as if it would be a free tag, and it was not
if (is_object($term)) {
...
}
// Previewing free tagging terms; we don't link them because the
// term-page might not exist yet.
else {
foreach ($term as $free_typed) {
...
Comments
Comment #1
hgmichna CreditAttribution: hgmichna commentedAnother way to reproduce it may be to upgrade to Drupal 6.16. At least on one of my Drupal installations that did the trick.
The message comes up, 21 times, when I update a forum topic. Vocabularies are not knowingly involved—there are none in this case, apart from the fact that there are forums.
Any ideas what I can do to repair this defect?
Addendum 2010-03-14 – The number of error messages is slowly rising. I now get about 30 of them, all identical, every day about two more. Still no idea how this can be fixed? I'm not a PHP programmer and I don't understand the description (above) of the error.
Comment #2
arhak CreditAttribution: arhak commentedthe root cause for your errors might be located at the same spot, but it might be due to other path reaching the same point
my advise: sit tight, it might take some time before other users complain about this same error
try looking support in the forums or in other issues related to upgrade path from 6.15 to 6.16 (I have seen a few of them)
there has to be more users having issues upgrading forums, try to bring their attention to this issue
BTW, these are just suggestions, since I'm the only one listening right now, and (by now) I won't fix it
Comment #3
hgmichna CreditAttribution: hgmichna commentedThanks! I'm wondering how many Drupal operators are affected. If not most, then why are some affected and some not?
Anyway, I will do precisely what you recommended.
Addendum 2010-03-14: I have added two lines (the first and the last, each containing "$errorreporting") to the code as a stopgap measure to suppress the warnings:
I don't understand the PHP code well enough, however, to judge whether the defect itself or my workaround has any bad side effects. If anybody knows a safer, better workaround, please let us all know.