When I try to select HS parent and child in content taxonomy field on user/register page, I get an alert "Received an invalid response from the server".
And consola (in firebug, Mozzilla) says :
http://localhost/jobnetworkfinal/hierarchical_select_json ;
response: <b>Fatal error</b>: Unsupported operand types in <b>C:\wamp\www\jobnetworkfinal\includes\common.inc</b> on line <b>2845</b>
But when I edit users account, everything works perfect.
My configuration is based on drupal 6.13 , HS 6.x-1.x-dev with patch, and don't have CTools/Delegator installed
Comments
Comment #1
WildKitten commentedI tried even this, but it didn't work. When I try to select parent and child while editing user, everything looks like it should. And I don't have any form_alter functions in my own module.
These are the modules that I use:
Thank you
Comment #2
Ryan Palmer commentedI'm having the same issue when using Content Profile module to expose a partial node form on the user register page.
The issue is with the function hierarchical_select_json(), near L283:
$hs_form_build_id = $_POST['hs_form_build_id'];$_POST['hs_form_build_id'] is not set in the $_POST array from this form, so the cached data doesn't get retrieved properly and everything else under it goes haywire.
I see that hs_form_build_id gets set from function hierarchical_select_after_build() in the first place. The case in which it does not get set would be when, around L671, both $_POST['hs_form_build_id'] is empty and count($names) returns false. It seems $names is a static variable both returned and reset by _hierarchical_select_store_name(). I did a quick ack and only found
static $names;in one place, in _hierarchical_select_store_name().Can anybody pick up from where I left off? I'm not sure where to go from here.
Comment #3
WildKitten commentedI found this , so it seams that there is some bigger problem between Content Profile and Hierarchical Select.
I guess we'll wait for Wim and Fago
Comment #4
wim leersThis may have fixed it. Could you please give the latest CVS version a try?
Comment #5
WildKitten commented@Wim
You have some syntax error:
Parse error: parse error, expecting `')'' in C:\wamp\www\jobnetworkfinal\sites\all\modules\hierarchical_select\modules\hs_content_taxonomy.module on line 167and have
function hs_content_taxonomy_common_config_form_submit($form_id, $form_state['values'], $content_type_name, $field_name) {.Think you need to remove ['values'] from $form_state['values']. I'll give it a try without it. :)
EDIT
Nope, i didn't work for user/registration page. And I had to copy files from http://drupal.org/node/342992#comment-1809098, so that I could enable Hierarchical Select Content Taxonomy.
Comment #6
wim leersComment #7
liliplanet commentedsubscribe thx!
Comment #8
Ryan Palmer commentedTried the latest CVS as per #4 and the ZIP files suggested in #5. I still see the same error in Firebug:
Comment #9
zmove commentedI have the same problem, perfectly work when going to /node/add/profile and get the same error when I try to use HS in the same profile node-type embed in the registration form.
/subscribe
Comment #10
WildKitten commentedI couldn't wait for HS to work on registration page, so I made workaround, not nice, but it works for me. You can see it here, second file. I also made it work with cck content multigroup.
Comment #11
lonestar790 commentedI have had the same problem with the HS and the node as profile. It has also shown up in Ubercart with one menu. All my other node types are working fine using the HS. I have found that it has degraded in the last version after users did some beta testing for me. The HS worked for a few entries and then stopped error "Received an invalid response from the server".
Firebug does also kick back:
500 Internal Server Error
1.13s jquery.js?w (line 13)
POST http://www.*******.org/hierarchical_select_json
500 Internal Server Error
969ms jquery.js?w (line 13)
ParamsHeadersPostPutResponseCacheHTMLJSON
Response Headers
Request Headers
{ "cache": [ ], "output": "\x3cdiv class=\"form-item\" id=\"edit-taxonomy-4-wrapper\"\x3e\n \x3clabel
for=\"edit-taxonomy-4\"\x3eGeneral Categories: \x3c/label\x3e\n \x3cdiv class=\" hierarchical-select-wrapper
hierarchical-select-level-labels-style-none\" id=\"hierarchical-select-20-wrapper\"\x3e\x3cdiv class
=\"hierarchical-select clear-block\"\x3e\x3cdiv class=\"selects\"\x3e\x3cselect name=\"taxonomy[4][hierarchical_select
][selects][0]\" class=\"form-select\" id=\"edit-taxonomy-4-hierarchical-select-selects-0\" \x3e\x3coption
value=\"none\" class=\"\"\x3e\x26lt;none\x26gt;\x3c/option\x3e\x3coption value=\"5\" class=\"has-children
\" selected=\"selected\"\x3eLiterary\x3c/option\x3e\x3coption value=\"3\" class=\"has-children\"\x3eVisual
\x3c/option\x3e\x3coption value=\"4\" class=\"has-children\"\x3eMusic\x3c/option\x3e\x3coption value
=\"2\" class=\"has-children\"\x3ePerforming Arts\x3c/option\x3e\x3c/select\x3e\x3cselect name=\"taxonomy
[4][hierarchical_select][selects][1]\" class=\"form-select\" id=\"edit-taxonomy-4-hierarchical-select-selects-1
\" \x3e\x3coption value=\"label_1\" class=\" level-label\" selected=\"selected\"\x3e\x3c/option\x3e\x3coption
value=\"51\" class=\"has-no-children\"\x3eCreative Non-Fiction\x3c/option\x3e\x3coption value=\"52\"
class=\"has-no-children\"\x3eFiction\x3c/option\x3e\x3coption value=\"53\" class=\"has-no-children\"
\x3eNon-Fiction\x3c/option\x3e\x3coption value=\"54\" class=\"has-no-children\"\x3ePlaywright\x3c/option
\x3e\x3coption value=\"55\" class=\"has-no-children\"\x3ePoet\x3c/option\x3e\x3coption value=\"46\" class
=\"has-no-children\"\x3ePoetry\x3c/option\x3e\x3coption value=\"50\" class=\"has-no-children\"\x3eCopy
Writer\x3c/option\x3e\x3coption value=\"56\" class=\"has-no-children\"\x3eScreenwriter\x3c/option\x3e
\x3c/select\x3e\x3c/div\x3e\x3cinput type=\"submit\" name=\"op\" id=\"edit-taxonomy-4-hierarchical-select-dropbox-add
\" value=\"Add\" class=\"form-submit add-to-dropbox\" /\x3e\n\x3c/div\x3e\x3cdiv class=\"dropbox\"\x3e
\x3ctable\x3e\x3ccaption class=\"dropbox-title\"\x3eAll selections\x3c/caption\x3e\x3ctbody\x3e\x3ctr
class=\"dropbox-entry first last dropbox-is-empty\"\x3e\x3ctd\x3eNothing has been selected.\x3c/td\x3e
\x3c/tr\x3e\x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv class=\"nojs\"\x3e\x3cinput type=\"submit
\" name=\"op\" id=\"edit-taxonomy-4-nojs-update-button\" value=\"Update\" class=\"form-submit update-button
\" /\x3e\n\x3cdiv class=\"help-text\"\x3e\x3cspan class=\"warning\"\x3eYou don\'t have Javascript enabled
.\x3c/span\x3e \x3cspan class=\"ask-to-hover\"\x3eHover for more information!\x3c/span\x3e But don\'t
worry: you can still use this web site! You have two options:\x3cdiv class=\"item-list\"\x3e\x3cul class
=\"solutions\"\x3e\x3cli class=\"first\"\x3e\x3cspan class=\"highlight\"\x3eenable Javascript\x3c/span
\x3e in your browser and then refresh this page, for a much enhanced experience.\x3c/li\x3e\n\x3cli class
=\"last\"\x3e\x3cspan class=\"highlight\"\x3eclick the \x3cem\x3eUpdate\x3c/em\x3e button\x3c/span\x3e
every time you want to update the selection, or when you\'ve checked some checkboxes for entries in
the dropbox you\'d like to remove.\x3c/li\x3e\n\x3c/ul\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div
\x3e\n\x3c/div\x3e\n", "log": null }
Any help would be greatly appreciated. Thanks a bunch. This a GREAT item that would be the perfect solution.
Comment #12
wim leersdrupal24 posted a comment in another issue concerning this issue. Basically, the patch for that issue (which was for D5) seems to solve the problem in this issue as well.
I've made it into a proper patch. drupal24 and others, please try this patch and I'll commit it :)
Comment #13
foodbo commentedsubscribe thx!
Comment #14
foodbo commentedoops.... subscribe again!!
Comment #15
wim leersPlease give the patch a try, foodbo :) See http://drupal.org/patch/apply.
Comment #16
ari-meetai commentedSubscribing after finding the error:
Parse error: syntax error, unexpected '[', expecting ')' in C:\Users\Ari\Documents\work\Penta Services\AVEI\wwwroot\home\sites\all\modules\hierarchical_select\modules\hs_content_taxonomy.module on line 167
Basically this is the same problem found in #5. It seems we're talking about two different topics here.
This happened after upgrading to the last -dev (18 Aug).
Went to apply the patch in #12; didn't matched completely(using Eclipse's "Apply patch") against hierarchical_select-6.x-3.x-dev of 18 Aug.
The syntax error is still there. I'm also using Content Profile. This seems critical.
Comment #17
wim leersApply the patch of #342992: Port HS support for Content Taxonomy to Drupal 6 first.
Comment #18
ari-meetai commentedok. Went there, did that... Now it's working.
Please, confirm that in the current state HS handles well two Taxonomy fields in one form. It doesn't work for me. The second field doesn't save the values. I recall seeing this somewhere but can't find it now. Thanks.
EDIT: Got it now (almost completelly) working using a combination of patches and commits. The CVS from Aug 18 doesn't work for me at all.
Comment #19
digi24 commentedThis is not specific to #12 it also applies to the logic in the current CVS:
I think we should be using $hs_form_build_id instead of $post_hs_form_build_id.
Comment #20
Jason Ruyle commentedI'm getting this same error and do not use content profile.
It started happening after upgrading to the dev version around the 18th.
I did run both patches in the order specified (I do have content_taxonomy).
Invalid response from server
As I was writing this post and trying to get the errors the system started to work
This is really weird. I've flushed the cache, ran drush refresh, etc. I was still getting this error, I went into firebug -> console to read out the errors, and started to click on the different terms dropdowns, and all of a sudden the queries started to take a long time. So I clicked results, and it displayed. After that, each time I ran it with console open, it started running slow. I closed console and reloaded the page. The HS ran fine.
I wonder if HS data that it processes is being stored in a weird fashion that doesn't get flushed. Or maybe there is a firebug addon that is an issue. I have firebug with drupalforfirebug, firebug cookie, firebug speedtest.
The one that has changed since is I installed the firebug episodes.
Comment #21
cristhian commentedSomething similar happened to me and I solved it by this way:
On the line 326 of hierarchical_select.module (function hierarchical_select_json()), there is this:
// Retrieve and process the form.
$form = call_user_func_array('drupal_retrieve_form', $storage['parameters']);
In drupal_retrieve_form, you have this:
$form = call_user_func_array(isset($callback) ? $callback : $form_id, $args);
Where $callback = 'node_form'.. but for some reason it wasn't included that function (stored in node.pages.inc).. and your form stays blank then drupal falls when hierarchical select calls drupal_render after that (common.inc, line 2845), so this is what I did in hierachical_selec.module (line 326), and it solved the problem:
// Retrieve and process the form.
module_load_include('inc', 'node', 'node.pages');
$form = call_user_func_array('drupal_retrieve_form', $storage['parameters']);
Maybe you could think this happened because I called the form with ajax, but the problem wasn't in the form generation, but in the hierarchical json callback. So maybe there should be a way for hierarchical select to decide when to include that misssing file..
Comment #22
kpaul commenteddude, you are the bomb. heh.
was having same symptoms when trying to include the form in a block. worked ok if i was on /node/add page, but got this error elsewhere. adding #21 got it working...
thanks!
kpaul
Comment #23
wim leersI took the time to build a site to test this. It worked out-of-the-box (without any patches) with HEAD. I'm using Taxonomy and not Content Taxonomy though.
I tested with both version 1.0 beta 4 and the latest code in the DRUPAL-6--1 branch.
Please update to the latest version of HS and possibly update Content Profile and report back.
Comment #24
boneless commentedI had the same problem as above (Invalid response from server) when ever I had more than 5 hierarchical taxonomy select fields on one page, now using 6.x-3.x-dev from 30/9/09 ans issue seems fixed!
Great work, really nice module!
Comment #25
wim leersExcellent :)
Comment #27
crea commentedsubscribing