Adding a term to a vocabulary appears to work, but the term does not appear in the vocabulary afterwards.

Meta tags appears to lose the parent information of a term when the root is the sole parent.

The parent array is OK during the initial save, but when the term is updated (by meta tags I presume, as this was not a problem before I installed meta tags) the parent array is now: array() rather than array(0). This causes the row from taxonomy_term_hierarchy to be deleted and nothing to be re-inserted.

Comments

Priority:Major» Critical

Didn't dig that far, but I can confirm Metatags caused taxonomy terms not to be saved on a dev site.

With Metatags disabled, everything's fine again.

Changing priority to "Critical", as it breaks some core functionality and can be tricky to find out on a website with many modules.

This is my first Drupal Newb questions...so be gentle :)

I need a fix or work around for this bug, as we are launching a big site next week. We have a section of the site, where we are updating the URL's for SEO, that pages have existed for a while. When the content editor goes to update the META tags, they get an error. I have not reproduced the error yet, as someone else was working.

1) Can we disable/re-enable META after updating Taxonomy changes and then presto-chango it will work?

2) Is there any chance that I could write some SQL to emulate an insert? I plan on just enabling the debug and scanning the SQL insert/delete on the taxonomy_term_hierarchy table, and then adding some SQL to a delete trigger, to emulate the module functionality?

I ran out of time trying to diagnose the actual failure mechanism and ended up patching the taxonomy module. This is not the way that this should be fixed. However for what it's worth here is the fix:

<?php
 
...
  if (empty(
$term->parent)) $term->parent = array(0);
  ...
?>

The file is .../modules/taxonomy/taxonomy.module, the line is added to the function: taxonomy_term_save() at line 656 in the current version:

<?php
   
}
  }
  if (empty(
$term->parent)) $term->parent = array(0);
  if (isset(
$term->parent)) {
    if (!
is_array($term->parent)) {
?>

Not the greatest piece of code that I've ever written, sorry. (And yet another patch that I have to propagate everytime I have to upgrade, sigh!)

Priority:Critical» Normal
Status:Active» Postponed (maintainer needs more info)

Could someone please provide further details on exactly how to reproduce this? I did a quick test with the latest -dev release and couldn't cause the problem to happen.

FYI this bug is holding up the next beta release - I don't want to release beta5 with this bug but I also can't replicate it. Please help by testing out the current -dev release.

Version:7.x-1.0-beta4» 7.x-1.x-dev