Closed (fixed)
Project:
Category
Version:
master
Component:
Wrapper modules
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
9 May 2006 at 02:26 UTC
Updated:
21 Apr 2007 at 20:32 UTC
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
Comment #1
Arnav commentedMore information:
If I unload the forums module (even if the taxonomy wrapper is retained) the error does not occur.
Comment #2
fossilfool commentedJust wanted to say that I'm getting this exact same error under identical conditions.
Comment #3
ianchan commentedI 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.
Comment #4
Jaza commentedFix 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.
Comment #5
(not verified) commentedComment #6
ianchan commentedPlease 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.
Comment #7
bdragon commentedComment #8
bdragon commentedOK, 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.
Comment #9
bdragon commentedFull 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.
Comment #10
bdragon commentedRolled 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...)
Comment #11
(not verified) commented