I hope this has not been posted already. I'm getting a few PHP errors when leaving a page with a HS form element in it.

warning: Missing argument 1 for drupal_retrieve_form() in /../includes/form.inc on line 179.
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given in /../includes/form.inc on line 218.
warning: uasort() [function.uasort]: The argument should be an array in /../includes/common.inc on line 2140.

In watchdog the location of them is here:

http://localhost:8888/../hierarchical_select_json

I had enabled the Dropbox option to allow multiple selections but when I click Add it doesn't do anything. Maybe this is related? I don't have the content_taxonomy module installed so I wouldn't think that's the problem.

Comments

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Postponed (maintainer needs more info)

You're probably not using the newest version of HS. Please get the latest tarball.

wim leers’s picture

Status: Postponed (maintainer needs more info) » Fixed

Going to assume this fixed it (trying to clean out the issue queue). If that's not the case, please set the status back to active.

Fayna’s picture

Status: Fixed » Active

I updated to 5.x-3.x-dev and it still has these errors. I cleared my Drupal cache also and it didn't seem to do anything.

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

This is not enough information. Are you creating your own form in which you're using HS?

Fayna’s picture

I'm editing a story node and using HS for the taxonomy form element. The HS doesn't add anything to the "All selections" list when I click "Add." I'm using a panel page to construct the form layout to make the taxonomy selection appear in the second column to the right. When I simply leave that edit page and go to "Administer" the errors appear.

I'm sorry, I hope this is enough information.

wim leers’s picture

Does it work when it's NOT in a Panels form? Please disable the Panels form for a second, just for testing.

wim leers’s picture

Status: Postponed (maintainer needs more info) » Active

Reproduced. I'm getting this when I use HS for exposed filters while I'm not logged in.

Vuds’s picture

Got that too, and I'd say more... HS is only working when I'm logged in as Admin. Any other user role is not working (I think that the fact it is not JS-loading sub-levels anymore is somehow connected).

wim leers’s picture

What you just described (failing for most users), has already been fixed: http://drupal.org/cvs?commit=125813. If you get the latest tarball, it should work. It's actually due to a bug in Drupal 5 (fixed in 5.8, which is yet to be released).

Vuds’s picture

I had just updated to the last CVS disposed (July 7, 2008 - 21:09) and it still happens. It's not loading the sub-levels with JS. If I submit, I got these warnings (for a 3-level HS field):

* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2140.
* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2140.
* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2140.
* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2140.
* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2140.
* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.
* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.

Nothing is saved.

For admin user, it's working ok.

Vuds’s picture

Upgraded to 5.8, errors yet.

Graining more the error:

A authenticated user doesn't have the sub-levels loaded but it's no being renewed by JS, keeping the values of the first load every time.

A anonymous user trying to register (in my case, I'm using Bio to put a required HS field in the register form) doesn't have even a load of sub-levels.

The warnings when trying to save the form:

* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.
* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.

It stills not saving any field value.

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

I'll need FTP/SSH and Drupal admin access to fix this.

This is at least related to http://drupal.org/node/279912, maybe that issue is even a duplicate of this one.

Vuds’s picture

Well, I don't have it online, since it's in develop yet, I'm using a vmware player.

Any other way I can help you? Do you want a copy of the site and mysql db?

Vuds’s picture

I was forgetting, since I actualized to 5.8, Active Select is also not working any more. The same symptoms of HS for anonymous users. I was thinking if Content Taxonomy was prepared to treat the security fixes also... or if that module utilized the "discovered hole" in core to do its job.

Vuds’s picture

Hmmm, narrowing even more!

The autocomplete widget, default for Content Taxonomy, is also NOT working.

It brings me a pop-up when trying to complete some data:

An HTTP error 403 occured.
http://address.site/?q=content_taxonomy/autocomplete/field_taxonomyfield...

I'm using all of the last versions of CT, AS and HS, in a updated 5.8 from 5.7 environment.

It really makes me thinking that CT was using a hole in the security for 5.7 that is now corrected in 5.8.

wim leers’s picture

Do you have the "access content" privilege enabled for anonymous users? That's necessary for Hierarchical Select AJAX updates to work.

Vuds’s picture

Another observation, I don't know if it's relevant, but I think it does since you spoke about it:

When I try to play around with another widgets, I had noted the "multiple values" is always NOT marked when I leave HS for test another widget. Then, when I would like to return to try HS, the option is not activated anymore, so I go there, select it and HS widget, send the form and return inside to configure, and I note again that the option is unable to play with, but it's also not selected again (in more simple words, there no "V" inside the gray square). Is it really selected like that?

wim leers’s picture

It will only be selected when you have enabled either save_lineage or the dropbox. This was not working in an older version, but that has been fixed. You're very sure that you're running the latest version?

Also, see and reply to #16.

Vuds’s picture

Okay, with #16 I could put it working again, thanks! But so, is there no way to keep the content private while a user is still anonymous?

And the errors still happening... :(

* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.
* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.

And it is not saving the info with the node yet. When I try to edit the same bio profile again and try to put any value in the HS field:

* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2145.
* warning: uasort() [function.uasort]: The argument should be an array in /var/www/html/includes/common.inc on line 2145.
* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.
* warning: Illegal offset type in /var/www/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.

Vuds’s picture

Hmmm, I'm saving lineage always and it's not selected! And yes, I'm running the last version, I had just downloaded the Jul/15 version (but I had saw that the HS main module is Jul/7).

Vuds’s picture

Two new things:

1) I had to go in the HS configuration, choosed as last term, saved, then choosed as lineage, saved again, go back to the widget options and now the multiple selections appeared marked. But then I save it, go in again and it's not marked anymore. The node_field_instance table doesn't have any widget settings saved for this field, it's really empty.

2) I'm noting that the variable table is getting more and more saved configurations for HS, apparently for every change of widget I do, and I just have this field working with HS. I'd like to know if I can delete it? It has settings with the fieldname as suffix with and without a number at end, and also without the fieldname but with and without numbers in the end. I think that the module should delete that data...

wim leers’s picture

Title: Getting uasort(), call_user_func_array() PHP errors » Multiple values setting not maintained when saving the field form.
Status: Postponed (maintainer needs more info) » Active

I could add a separate permission for it… But that means *everybody* would have to enable it *manually*. But then again, I could enable it automatically

New things:
1) DARN! Reproduced! Excellent catch. I bet it's because a disabled form item and disabled form items are not included in POST, hence it defaults to FALSE.
2) It's probably normal that it happens for each CCK field that gets deleted. It won't create a new config for every *change* in a config/field though ;) (That would be *very* silly!)

wim leers’s picture

Title: Multiple values setting not maintained when saving the field form. » Always allow access to server callback *and* Multiple values setting not maintained when saving the field form
Status: Active » Fixed

Both fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.