This is my first bug report on Drupal and furthermore I'm french so I hope I'm doing this correctly. I'm working with Drupal 6.9 on a local installation. If the Content Taxonomy Options module is activated, I get the same following lines repeated many times on a preview of a Übercart product class node :
"# warning: Illegal offset type in isset or empty in C:\wamp\www\XXXX\modules\taxonomy\taxonomy.module on line 1015.
# warning: Illegal offset type in C:\wamp\www\XXXX\modules\taxonomy\taxonomy.module on line 1016.
# warning: Illegal offset type in C:\wamp\www\XXXX\modules\taxonomy\taxonomy.module on line 1019.
# warning: Illegal offset type in C:\wamp\www\XXXX\modules\taxonomy\taxonomy.module on line 592."
When published anyway, some Taxonomy terms added through CCK fields vanished. This trouble disapears when I unactivate this particular module. I use many modules but I can give a complete of partial list if needed.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2009-03-23_nothingdisplayedanymoreinthevocabulariesarea.png | 683 bytes | ErwanF |
Comments
Comment #1
ErwanF commentedErratum
- I made a confusion between two modules. The module I am talking about is CT Options, not Option widgets.
- "When published anyway, some Taxonomy terms added through CCK fields vanished." After a new check, this is not exact. Terms disapear if the module is unactivated, which sounds more logical.
Comment #2
mh86 commentedmaybe it's a conflict with the ubercart module.
do you get the same error messages with a different own content type and content taxonomy fields?
Comment #3
cbow commentedI was getting the same message (no Ubercart). It started after upgrading from d6.9 to d6.10. I "solved" to problem by going into the CT field for my content-type then unchecking the "Save values additionally to the core taxonomy system (into the 'term_node' table)." option, saving, re-checking, saving.
Comment #4
mh86 commentedthanks for this information. I'm still running drupal 6.8 on my local installation.
I'm going to update my installation and check this issue again
Comment #5
mh86 commentedupdated my drupal installation and still not getting any error
maybe it has been fixed with this issue (fixed today)
Comment #6
ErwanF commentedI didn't try with another content type. Actually I wonder if it is a trouble with Taxonomy Image and/or PathAuto modules. This was temporarly "Solved" by not using a CCK Taxonomy field to display an image from Taxonomy image and unactivating PathAuto for the moment. I'm obviously new in Drupal community and still have trouble to fully understand Taxonomy image module... I'm sorry if this doesn't sound very clear. I will try to do better next time... Anyway thanks for your replies.
Comment #7
ErwanF commentedBack and going on trying to find the answer. This issue occurs on another of my content types too, though this one isn't linked at all with Übercart.

You must know that I want to display all the terms associated with this content type on this content type by using CCK fields (because I don't like the default taxonomies' display). As a result, the area named "vocabularies" become empty on my content type edit page (see my attachment, with this "vocabularies" area in French).
But according to my latest trials, this can't be empty, otherwise I get this precise following message again (x 5):
The string talking about a "line 1015" may miss a content in this precise area. So I created a test vocabulary named "trial", I populated it with two terms, "trial 1" and "trial 2", then I associated this vocabulary with this buggy content type, in order to have something in the "vocabularies" area (obviously not displayed anywhere else with a CCK field). Now it works fine (no warning anymore on my preview page)! But since I display those test terms in a CCK field (leaving the vocabularies area empty again), I get the same issue. Now I know that I need some content in this vocabularies area. So I think I will delete my last CCK field, keep this test taxonomy and hide it using the Taxonomy Hide module... Any better idea?
Comment #8
skizzo commented@mh86 Re #5 : I don't think that http://drupal.org/node/395328 solves this issue.
I upgraded from 6.x-1.0-beta6 to 6.x-1.x-dev 2009-03-17 but I still see the error. I have a simple content type with
Going into node editing, when clicking on preview I get the error
warning: Illegal offset type in isset or empty in /var/www/drupal/modules/taxonomy/taxonomy.module on line 1015.If I now create a vid 5 and assign it to content type via admin/content/taxonomy/edit/vocabulary/5 then preview is ok, no error.
I could assign vid 4 as both Content Taxonomy field AND direct vocabulary assignment, but I assumed that this would
be a bad practice... is that assumption wrong? Thank you.
Comment #9
rwd commentedThe same issue has been encountered here with Drupal 6.10, CCK 6.x-2.2 and Content Taxonomy 6.x-1.x-dev (2009-Mar-17).
To reproduce it:
Comment #10
no2e commentedSame issue for me -- did the same as richardwdoe described in #9.
Comment #11
rwd commentedFollowing up on my previous comment #9, further investigation suggests that these warnings will not be displayed if you:
In other words, if you have at least one vocabulary associated with the content type that is not handled by content_taxonomy, you will not get the warnings.
Comment #12
ntt commentedsubscribing
Comment #13
ErwanF commentedThanks, Richardwdoe. That's exactly what I found and tried to explain in #7 ;-)
Comment #14
mh86 commentedHi!
Finally I was able to reproduce the problem (thanks to the detailed descriptions). The Taxonomy module was throwing the warnings on preview because of a wrong format in $node->taxonomy. This happened when every core taxonomy field got hidden. I think this problem already existed for a longer time, at least since some Content Taxonomy versions.
The problem was quite hard to debug, but I think I found a working fix (a bit strange, but ok). I committed the changes to the dev version. So, when trying the fix, be sure to have the right version. Fix will be included in the next release anyway ;)
Comment #15
ErwanF commentedThanks a lot for this work!
Comment #16
fletch11 commentednot sure if this was committed to the latest (May 17) release but I'm still getting these errors as well.
thanks for all your work.
Comment #17
malc_b commentedI was getting this but the mode I have in taxonomy fixes this. This has been reported as a taxonomy issue but isn't fixed. See http://drupal.org/node/275352#comment-1422794 for my solution. If you add
to taxonomy just be line 1011 if (!isset($terms[$tid])) you can see the majority have $tid as numeric but some are complete objects.
Comment #19
aidanlis commentedI've just checked out the latest branch, DRUPAL-6--1, and I'm still getting the same errors. See http://drupal.org/node/275352 for related issues.
Comment #20
pepe roni commentedHaving same problem with 6.x-1.x-rc1.
Content Taxonomy writes taxonomy terms to core database, option widgets activated (but does not matter). Preview mode throws the described errors.
I use Content Taxonomy to have a per node type restriction / representation for taxonomy terms. In one node type it is allowed to add terms, in another node type it is not. In one node type you have single selection, in another node type you have multiple selection. I can not do without this module.
Comment #21
crea commentedSubscribing...downloaded latest CT, and problem is still there..
Comment #22
crea commented@mh86: I found error with your patch: in form_alter hook you seem to unset $form['taxonomy'] while you should actually work with $form['#node']->taxonomy (as taxonomy code which is causing preview problems). Also, at the beginning of the funcion you make following check:
and I checked that during preview $form['taxonomy'] is empty so function simply terminates at the beginning because of this check.
If I understand it correctly, during preview whole node object is prepared in $form['#node']. If I simply enter at the beginning following code:
then preview works without errors ( but it's ofcourse not solution, cause it disables normal non-CT vocabs too, I think).
So my conclusion: seems like entire content_taxonomy_form_alter() function needs major rework. Those $form_state's seem to be tricky and require good understanding of what is happening deep and what needs to be done. If taxonomy code behaves differently in different $form_states then we should too, but currently same code runs in CT function.
Comment #23
crea commentedComment #24
crea commentedThis happens not only with Options widget.
Comment #25
mh86 commentedI added another few lines to prevent an empty taxonomy form array on preview. it seems like this fixes the warnings for me. I hope this is working now.
Comment #26
mh86 commentedaccidentally changed issue settings with previous comment..
Comment #27
rwd commentedGoing through the same steps I detailed in comment #9 with the dev versions dated 2009-Jul-16 and 2009-Aug-12, this issue looks to be fixed in both.
Thanks mh86.
Comment #29
merilainen commentedIn my dev-version from Sep 13th I still get this error.
Comment #30
merilainen commentedand active
Comment #31
fletch11 commentedme too... sorry
Comment #32
roderikIt seems this was 'unfixed' in #552874: php undefined variable notices. The patch in #4 of that issue, fixes things for me.
@crea / #22: I have spent some hours debugging this and was thinking exactly the same as you. However, apparently mh86's changes do fix everything (and make sure that taxonomy_preview_terms() isn't called unnecessarily? I'm too tired of this to re-check that ;) )
Comment #33
zoo commentedMe too experiencing the problem with drupal6.15 / content taxonomy 6.x-1.0-rc2
I'm not an expert of php, I just flag the error I'm having and paste bottom the warnings I get.
Thank you, zoo
Comment #34
Hobbes-2 commentedSubscribe
Comment #35
cerup commentedSame thing here...can we get a final commit to the fix for this? If it was fixed in the past, why is that not being committed?
Comment #36
mh86 commentedpatch from #552874: php undefined variable notices committed, this should fix this issue again.
please check out the latest dev version and give me some feedback if everything works
Comment #37
zoltán balogh commentedsubscribe
Comment #38
ari-meetai commentedConfirmed as fixed for my installation with -dev.
Drupal 6.15
PHP 5.2.6
Comment #39
temp commentedI have same error on preview with latest dev version.
Comment #40
bserem commentedproblem appears in d6.16 and latest -dev in my site too
Comment #41
jbomb commentedConfirming #40 issue persists in Drupal 6.16 and content_taxonomy-dev as of 28 May 2010.
Comment #42
jbomb commentedComment #43
jbomb commentedhold on, i need to take my foot out of my mouth. The -dev version does resolve this issue for me.
Comment #44
zeezhao commentedsubscribing. Seen this issue in dev version w/ drupal 6.16, in conjuction with hierarchical_select-6.x-3.1.tar.gz
Comment #45
zeezhao commentedPosted the issue I am seeing here: http://drupal.org/node/815796
Please confirm if the patch is in the latest dev version. Thanks
Comment #46
jbomb commentedI can confirm that the -dev version (as of 3 June 2010) resolves the following error in Drupal 6.16. I received the error when submitting a node for preview. The dev version resolved this issue for me on two sites.
Comment #47
my-family commentedI experienced the same problem and can confirm that 6.x-1.x-dev (release form 2010-Apr-08) fixed it, thanks.
Comment #48
magnus commented