Fatal error: Call to undefined function _category_flatten_values() ... sites/all/modules/category/wrappers/taxonomy/taxonomy.mo
CharlieHipHop - September 17, 2009 - 19:13
| Project: | Category |
| Version: | 6.x-2.0-alpha4 |
| Component: | Wrapper modules |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Can't create new categories or containers without getting this error. It looks like it considers something to be legacy.
if (!empty($behavior) && empty($node->category['is_legacy'])) {
/*line 834 */ _category_flatten_values($node);
if ($behavior == 'category') {
taxonomy_save_term(_taxonomy_category_into_term($node), TRUE);
}
else {
taxonomy_save_vocabulary(_taxonomy_container_into_vocabulary($node), TRUE);
}
}
if (!empty($node->categories)) {
taxonomy_node_save($node, _category_filter_pick_elements($node->categories));
}Any ideas?

#1
This is confusing, since the recent code (6.x-2.0-rc1) doesn't have this code at line 834, and in the other hand, older versions did have the referenced function defined. It's removed now, as a part of cleanup in internal workflows (the conversion is now handled automatically by form submission handler, so we don't need to have these extra fixes all around the place).
What version are you using? If 6.x-2.0-alpha4 (as the issue got filed), then it's very outdated and very buggy, and you should upgrade to recent code. And if you're using 6.x-2.0-rc1, then you most probably didn't upgrade correctly/successfully, having some older version of Taxonomy Wrapper still in use. Is the version here just that of the wrapper, not entire Category package? These two shouldn't be out-of-sync.
I guess, that while upgrading Category, you maybe only just copied the new files over old ones - beware: The taxonomy wrapper files are renamed on installation, so these are *not* upgraded by a mere copy of new package. You need to uninstall the wrapper (from Wrappers tab on Categories admin page) prior to upgrade, and install the (new) wrapper again afterwards (or else deal with the files manually - there are three files in the wrappers/taxonomy directory distributed with extra .php extension, which should be renamed to match the actual in-use installed files).
Maybe this needs some additional line somewhere in the .txt files...
#2
Hmm, well, that's interesting. Perhaps I've been hacked or something. I downloaded the latest, but I guess somehow it got switched out.
OK, I shall explore further. Thanks for the insight.
#3
OK, well, I figured it out. For some reason, the Category module refuses to update if the Book wrapper is enabled.