Error when creating new term

samwarren - February 14, 2009 - 11:10
Project:Hierarchical Select
Version:6.x-3.x-dev
Component:Code - Taxonomy
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

I enabled "Allow creation of new terms". When I use it with forum, after I select and type in a new term and click "create", I got this message:
"Received an invalid response from the server". And that page basically frozen. I tried this with Chrome, IE, and Firefox, same result.
I also tried this at work, no problem. Maybe server related? Both of this tests are on localhost.

Another problem:
I have a free tag vocabulary (called "other keywords"). My main vocabulary is "sitewide category". With Forum, I put "sitewide category" first, followed by "other keywords". Here is the problem: whenever I select an item in sitewide cetegory (just by clicking a term), a new field for "other keywords" is duplicated. After several selections on "sitewide category", I got a series repeated "other keywords" fields.

AttachmentSize
duplicated field.jpg33.11 KB

#1

samwarren - February 17, 2009 - 04:53

Whenever I chose "create new term", the form is disabled (cannot click preview, submit). And the site creates the following three log entries. -- Always these three together.
(This is a great module. It is exactly what I wanted. Please help me to make it work.)

Error log #1:
Location: http://localhost/mysite/hierarchical_select_json
Message: Missing argument 2 for drupal_retrieve_form() in C:\apache2triad\htdocs\mysite\includes\form.inc on line 320.

Error log #2:
Location: http://localhost/mysite/hierarchical_select_json
Message: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given in C:\apache2triad\htdocs\mysite\includes\form.inc on line 366.

Log #3:
Location: http://localhost/mysite/hierarchical_select_json
Message: uasort() [function.uasort]: The argument should be an array in C:\apache2triad\htdocs\ mysite\includes\common.inc on line 2832.

#2

rick_deckard - February 25, 2009 - 05:06

Same problem, current dev version of HS.

What's strange is that it is context dependent. I'm using the Content Profile module, which means that I can edit profile content either via
1. My Account -> Profile -> Edit
-- or --
2. Create Content -> Profile

Using method 1, I get no errors and it runs normally. Using method 2, I have the issue as samwarren desribes it.

#3

rick_deckard - February 25, 2009 - 06:00

Okay, some more details. Running it with Firebug on, it reports

1. jquery.js on line 13 (which is the whole jsquery javascript)

Request Headers:
X-Requested-With: XMLHttpRequest
Referer: http://example.com/node/10/edit?destination=admin%2Fcontent%2Fnode

Post:
field_disciplines[tids][hierarchical_select][selects][0] - label_0
field_favorites[tids][dropbox][hidden][lineages_selections][0] - a:1:{i:0;s:3:"132";}
field_favorites[tids][hierarchical_select][selects][0] - 70

Response:

Fatal error: Unsupported operand types in /home//public_html//includes
/common.inc
on line 2834

2. Then in /hierarchical_select/hierarchical_select.js I get

Drupal.HierarchicalSelect.state[hsid].log is undefined
throwError()()hierarch...lect.js?y (line 183)
error()()hierarch...lect.js?y (line 499)
(?)()()jquery.j...e3Q%3D%3D (line 1)
(?)()()jquery.j...e3Q%3D%3D (line 1)
[Break on this error] Drupal.HierarchicalSelect.state[hsid].log.push([ message ]);

I'm thinking this might have to do with hierarchical_select_get_form_item returning FALSE under certain conditions, which is not an array, so when that gets passed to drupal_render and it hits the line where I'm getting the fatal error it encounters this on common.inc line 2834:

  $elements += array('#title' => NULL, '#description' => NULL);

So it's trying to do an array union on a boolean, which will cause a fatal error in PHP. But when I add a line between hierarchical_select.module between lines 303 and 304 to make sure it gets passed an array, the fatal error goes away, but the select no longer works either (that is, I select, but the list of child terms doesn't expand out).

  $part_of_form = _hierarchical_select_get_form_item($form, $name);
  if (!is_array($part_of_form)) { $part_of_form = array(); }
  $output = drupal_render($part_of_form);

So I'm pretty sure HS is sending a scalar when it needs to send an array and that is causing the error.

#4

rick_deckard - February 25, 2009 - 06:14

Now I'm getting somewhere - POST data says

hsid 0

So $_POST['hsid'] is undefined - that explains things a bit more. Now just have to figure out why. Other POST data expected by that function are okay

form_build_id form-adf5708c1e5d25acdaeb64c040763f31
form_id profile_node_form
form_token db10f6de9721c8ad7f71f180101a1315
hs_form_build_id hs_form_61a9131fd92adfde3c93226d46c0acaa
hsid 0

(This is Firebug console POST data)

When I use the web developer toolbar to look at the generated source code, there is a hidden field for hs_form_build_id, but I don't see hsid defined anywhere

<input name="hs_form_build_id" id="edit-hs-form-build-id" value="hs_form_61a9131fd92adfde3c93226d46c0acaa" type="hidden">

#5

rick_deckard - February 25, 2009 - 18:03

Okay, compared the generated code from pages that work and ones that don't - no major differences. Put it on a testbed and disabled all modules with a lot of Javascript and then started re-enabling, cleared cache between every page load.

CTools: Okay
WYSIWYG: Okay
Taxonomy Manager: Okay
JQuery Menu: Okay
Advanced Taxonomy Block: Okay
Image Assist: Okay
Panels: Okay
Delegator (for Panels3): FAIL!

So a bit more searching suggests that this is
1. Duplicate HS issue of http://drupal.org/node/368471

2. Duplicate of Delegator issue http://drupal.org/node/370487

3. All of which are probably related to the Delegator Node Edit override issue, which is marked as fixed, but probably isn't: http://drupal.org/node/367213

I'm not sure at this point whether to lay all this on Delegator and to close all HS bugs, or what.

#6

Wim Leers - March 11, 2009 - 22:31
Status:active» duplicate

#7

fralenuvol - April 24, 2009 - 13:42

I have the exact same issue as stated in comment #2.

I enabled Content Profile at registration and if I access the hierarchical select taxonomy for anonymous users via:
User Registration (with the embedded Profile from "Content Profile")
I receive "Invalid response from server"

If I access the hierarchical select for anonymous users via:
Create Content -> Profile
hierarchical select works fine.

In my case I disabled all other modules and therefore tracked down this issue with "Content Profile" module.
Any idea?

#8

servicedevis - May 29, 2009 - 17:11

Just for information i have the exact same issue as stated in comment #1 and after disable the memcache admin module, all rework .

 
 

Drupal is a registered trademark of Dries Buytaert.