While saving a book page with two associated terms from two different vocabularies, I get the following error:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/drupal-5.1/sites/default/modules/faceted_search/taxonomy_facets.module on line 461.

And indeed, when I view $node->taxonomy with the devel module, the "$node_tids" appear to be objects, not arrays:

Array
(
    [2] => stdClass Object
        (
            [tid] => 2
            [vid] => 1
            [name] => Large
            [description] => 
            [weight] => 1
        )

    [7] => stdClass Object
        (
            [tid] => 7
            [vid] => 2
            [name] => Apples
            [description] => 
            [weight] => 1
        )
)

Comments

David Lesieur’s picture

Strange, I can't reproduce this. Does this happen when creating a new book page, or when updating an existing one, or in both cases? And do you happen to have other installed modules that manipulate the taxonomy?

Nick Urban’s picture

The problem occurs during creation or update.

I don't have any other taxonomy modules installed, but I have been manipulating the term_nodes table directly through SQL. Maybe that has caused a problem?

I'm confused why it would ever work though, because the values of the array are not other array, and yet they are treated as such. Consulting the taxonomy section of Pro Drupal Development describes the structure in the same way as printed by the devel module.

David Lesieur’s picture

The taxonomy variable is usually an array of objects (terms). But from what I can see matters are different upon hook_nodeapi() insert/update, where the $node's taxonomy comes from the node submission form and is structured as form values.

Apparently we are somehow not getting the same behavior... I don't think your SQL manipulations have anything to do with this.

taxonomy_facets might have to support both structures (array of arrays, and array of objects) as does taxonomy_node_save(), which is called by taxonomy_nodeapi() on insert/update. Strange.

David Lesieur’s picture

I have just committed an attempt to fix this problem, although I still can't reproduce it... Would be nice if you could test the dev version and report whether the bug has been fixed. Thanks. ;-)

David Lesieur’s picture

Status: Active » Fixed

I'll just assume that this is now fixed. We can re-open the issue if needed.

Anonymous’s picture

Status: Fixed » Closed (fixed)