This pertains to the Category 4.7.0 tar archives released on 03-May and 08-May.

On attempting to delete categories and containers, I receive the following fatal error: "Fatal error: Cannot use object of type stdClass as array in <>/modules/forum.module on line 152". I have the taxonomy wrapper installed under .../sites/modules.

The site runs Drupal 4.7.0. It is not a fresh installation, but has been upgraded graduallly from the 4.7 betas.

Comments

Arnav’s picture

More information:

If I unload the forums module (even if the taxonomy wrapper is retained) the error does not occur.

fossilfool’s picture

Just wanted to say that I'm getting this exact same error under identical conditions.

ianchan’s picture

I receive a similar error:
Cannot use obejct of type stdClass as array in /var/.../modules/forum.module on line 152

Error does not occur after deactivating forums module.

Jaza’s picture

Component: Code » Wrapper modules
Status: Active » Fixed

Fix committed for HEAD and 4.7. You will need to re-install the taxonomy wrapper after upgrading to the latest version of category.

Apparently, the taxonomy_get_vocabulary() function can't decide whether to return an array or an object. It returns an object, but in many cases, that return value just gets converted to an array. This is more of a core taxonomy issue, but it has adversely affected the taxonomy wrapper for category.

Anonymous’s picture

Status: Fixed » Closed (fixed)
ianchan’s picture

Version: » master

Please give an extended explanation on how to resolve this problem. I deactivated the taxonomy modules, put in the latest category module, but it still presents that error. I am using 4.7.3.
Thank you for your assistance.

bdragon’s picture

Status: Closed (fixed) » Active
bdragon’s picture

Assigned: Unassigned » bdragon

OK, this is just silly.
This is causing massive breakage in some places.
I'm going to be rolling this one back unless doing so causes more problems than having it in.

bdragon’s picture

Full analysis:

Over the 4.7 development cycle, all of the hook_taxonomy operations were converted to use arrays.

(Some notable changes --)
http://drupal.org/node/44381
http://drupal.org/node/57523
http://cvs.drupal.org/viewcvs/drupal/drupal/modules/taxonomy.module?r1=1...

Anyway, taxonomy_get_vocabulary is a public function. We _need_ to work the same way.

In any case, http://cvs.drupal.org/viewcvs/drupal/contributions/modules/category/wrap...
fixed the problem that this workaround was fixing, so it isn't needed anyway.

Rolling back shortly.

bdragon’s picture

Status: Active » Fixed

Rolled back on HEAD, DRUPAL-5, and DRUPAL-4-7. I also added a workaround for tagadelic's path issues.
Maintaining API parity is the primary goal of the wrapper, and some modules actually USE taxonomy_get_vocabulary.

While fixing it, I also added some simple caching so performance is slightly better (Actually, the original one loads all the vocabs the first time and caches them...)

Anonymous’s picture

Status: Fixed » Closed (fixed)