warning: array_shift() [function.array-shift]: The argument should be an array in C:\webserver\Apache2.2\htdocs\drupal\includes\form.inc on line 1333.
This error present even in clean installations, after update taxonomy vocabulary to use HS.
What I have:
Clean Drupal Installations
Clean URLs +
Hierarchical Select 6.x-3.5 2010-Sep-08
Hierarchical Select Taxonomy 6.x-3.5 2010-Sep-08
Status report of Hierarchical Select:
All updates installed. Implementation modules are installed correctly.
What I do:
1) I set up clean Drupal Installations
2) was Enabled Hierarchical Select
3) was Enabled Hierarchical Select Taxonomy
4) was Created Vocabulary (no specific configuration, only vocabulary name)
5) was Enabled Hierarchical Select for this (in 4 steps) vocabulary
6) When I saved configuration, I seen a error:
warning: array_shift() [function.array-shift]: The argument should be an array in C:\webserver\Apache2.2\htdocs\drupal\includes\form.inc on line 1333.
Comment | File | Size | Author |
---|---|---|---|
#33 | hs_taxonomy.module-910798.patch | 2.21 KB | tacituseu |
Comments
Comment #1
Wim LeersI'll look into this when I get back from my current vacation.
Thanks for the very clear bug report, the way it should be! :) What a relief, to see a proper bug report, once in a hundred or so times :)
Comment #2
Andrew Gorokhovets CreditAttribution: Andrew Gorokhovets commentedThanks :-)
Comment #3
gamesmasta CreditAttribution: gamesmasta commentedI received the same message under similar circumstances:
warning: array_shift() [function.array-shift]: The argument should be an array in /usr/local/projects/drupal/drupal-6.14/includes/form.inc on line 1331
Also tried it on my local XAMPP server, same issue:
array_shift() expects parameter 1 to be array, null given in C:\xampp\htdocs\drupal-6.19\includes\form.inc on line 1337.
This was received after saving a vocabulary.
Comment #4
gamesmasta CreditAttribution: gamesmasta commentedSorry for double post: I'm not sure if this is a result of the above issue or an unrelated issue:
Before: http://imgur.com/7If3P.png
After: http://imgur.com/ahaee.png
If I add the selected tag for Armenian as Advanced, then my previously selected languages (Arabic & Bengali) will automatically be populated with Advanced entries also. Expected outcome is that it does not populate other languages.
Vocabulary list contains terms of languages and 3 proficiency terms (Beginner, Intermediate, Advanced), which are set with the previous languages being set as parents.
Comment #5
marcxy CreditAttribution: marcxy commentedsame exact bug.
Subscribed.
Comment #6
Wim LeersComment #7
tobiberlinsubscribed
Comment #8
no2e CreditAttribution: no2e commented(same bug here)
subscribed
Comment #9
kpm CreditAttribution: kpm commentedsame... subscribed
Comment #10
DavidBoo CreditAttribution: DavidBoo commentedsame
Comment #11
Alessandro S. CreditAttribution: Alessandro S. commentedsame... subscribed
Comment #12
vip_sa CreditAttribution: vip_sa commentedSame bug here
Comment #13
dallasw1983 CreditAttribution: dallasw1983 commentedI'm running into the same problem...
I had this before on another module. I believe the problem to be PHP5. I found the fix to my other problem here http://drupal.org/node/36408
I don't know much about PHP code, but I'm guessing that line 1337 should be array_merge
should be something like
I did try this but I got the WSOD, so yet again, I don't know much about PHP...
Comment #14
yamenshahin CreditAttribution: yamenshahin commentedSame error here
Comment #15
REMUU CreditAttribution: REMUU commentedHaving the same problem unfortunately
Comment #16
shiolo CreditAttribution: shiolo commentedsame problem..
Comment #17
botrisSubscribe
Comment #18
Berliner-dupe CreditAttribution: Berliner-dupe commentedSubscribe
Comment #19
kpm CreditAttribution: kpm commentedI'm not sure if this info helps...
I have created a few vocabularies, 'Section', 'Location', and 'Tags'. The first two use Hierarchical Select, the last is standard Drupal free tagging.
I have vertical tabs enabled and on the 'Vocabularies' tab, where the list of vocabularies should appear when editing a post that has terms, what I see is this:
Vocabularies
null,
Tags: example 1, example 2
So I'm getting the 'null' reported under the vocabularies section of a create or edit post wherever Hierarchical Select is used. The Tags vocabulary is listed with whatever tags already exist on a post.
If it is a new post, then all that is displayed is the "null, "
Comment #20
Aldus CreditAttribution: Aldus commentedsubscribe
Comment #22
tobiberlinsubscribing... changed the vocabulary to use Hierachical Select and got the message.
Comment #23
Amy_M CreditAttribution: Amy_M commentedSubscribing
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentednot sure if is coincidental that its on line 1337
Comment #25
tribe_of_dan CreditAttribution: tribe_of_dan commentedSubscribe
Comment #26
perke+1, subscribing
edit: just noticed it is only throwing error when vocabulary is not set to "Multiple select" (and that makes sense to me)
Comment #27
gregoiresan CreditAttribution: gregoiresan commentedGot the error with "Multiple Select" enabled. But, I don't have the error when I re-edit it... only just when I enable Hierarchical Select.
Comment #28
juantoyoshi CreditAttribution: juantoyoshi commentedsuscribing
Comment #29
Stomper CreditAttribution: Stomper commentedI am getting the same error on when I save a taxonomy vocabulary and enable hierarchical select with force user to select deepest level:
"warning: array_shift() [function.array-shift]: The argument should be an array in "
I am running version 6x-3.6 on D6.19 if it matters, as this issue was originally created for version 6x-3.5
Comment #30
ttaylor797 CreditAttribution: ttaylor797 commentedI am experiencing the same issue as soon as the module is enabled.
Comment #31
dietmarg CreditAttribution: dietmarg commentedsubscribe
Comment #32
NaX CreditAttribution: NaX commentedI think this bug is caused by the validate function
hierarchical_select_taxonomy_form_vocabulary_validate()
in hs_taxonomy.module on line 756.I changed this:
To this:
And the error went away. The problem seems to be that sometimes the tags array does not exist and then when form_set_value() is called there is no #parents attribute to pass to _form_set_value(). I don't know why the tags array is sometimes empty, maybe HS is un-setting it some place.
Suggestion: With regards to PHP bugs like this one.
For community members that what to try and help trace bugs should consider using the Devel module. I traced this bug using the Devel module by setting Error handler to Backtrace. You will start getting a lot of notices and sometimes "Cannot modify header information" errors. These can all be safely ignored. The backtrace will then give you the function execution order in reverse starting at the the point of the error. Even if you not a PHP dev just by being able to point other devs in the right direction can help a lot and save a lot of time and more importantly fix bugs faster.
I hope somebody else finds this useful.
Comment #33
tacituseu CreditAttribution: tacituseu commentedIt's caused by
$form['tags']
being undefined, it should be$form['settings']['tags']
. It happens only when enabling hierarchical taxonomy and not on subsequent edits because this code inhs_taxonomy_form_taxonomy_form_vocabulary_alter()
creates it (should set$form['settings']['tags']
and$form['settings']['multiple']
):Comment #34
Wim LeersThat must have changed in core then, because this surely was working at some point in time.
Thanks for the excellent patch, tacituseu! :) Committed!
http://drupal.org/cvs?commit=495404