On admin/content/taxonomy/edit/vocabulary/1 the preview works fine. I have selected there "Save term lineage" as per your Troubleshooting tips. Also "Multiple select" is selected, but in the preview it's not possible to select multiple terms.

I then clear all caches (using admin_menu) and go to node/add/job and do shift-refresh (just to be sure) and I choose the one item which has children and I get "Received an invalid response from the server."

The server response to the URL hierarchical_select_json was of course "Unsupported operand types in includes/common.inc on line 2886"

I am logged in as user #1 so I don't think it could be a permissions problem.

I looked through the code a bit looking for something obvious and I did find this:

    $extra =  '<input class="autocomplete" type="hidden" id="'. $element['#id'] .'-autocomplete" value="'. check_url(url($element['#autocomplete_path'], NULL, NULL, TRUE)) .'" disabled="disabled" />';

around line 131 of includes/theme.inc which I believe should be:

    $extra =  '<input class="autocomplete" type="hidden" id="'. $element['#id'] .'-autocomplete" value="'. check_url(url($element['#autocomplete_path'],array('absolute' => TRUE))) .'" disabled="disabled" />';

But anyhow that's not the source of my problem.

Could you suggest why it works in the preview yet not on the "real" page?

Thanks.

Here are active modules on this site. All are latest stable releases as of today:

"name"
"admin_menu"
"admin_menu_toolbar"
"block"
"blog"
"blogapi"
"calendar"
"civiaddresslog"
"civicrm"
"comment"
"contact"
"content"
"content_copy"
"content_multigroup"
"content_permissions"
"content_profile"
"date"
"date_api"
"date_popup"
"date_timezone"
"dblog"
"fieldgroup"
"filefield"
"filter"
"forward"
"help"
"hierarchical_select"
"hs_taxonomy"
"hs_taxonomy_views"
"image"
"imageapi"
"imageapi_gd"
"imageapi_imagemagick"
"imagecache"
"imagecache_ui"
"imagefield"
"image_attach"
"image_import"
"image_im_advanced"
"img_assist"
"jcalendar"
"jquery_ui"
"jstools"
"kc_custom"
"link"
"menu"
"messaging"
"messaging_mail"
"messaging_simple"
"node"
"nodereference"
"notifications"
"notifications_content"
"notifications_tags"
"notifications_ui"
"number"
"optionwidgets"
"path"
"pathauto"
"php"
"profile"
"registration_role_with_approval"
"scheduler"
"search"
"system"
"taxonomy"
"taxonomy_csv"
"text"
"token"
"tokenSTARTER"
"token_actions"
"tracker"
"tree_menus"
"update"
"upload"
"user"
"userreference"
"views"
"views_export"
"views_rotator"
"views_ui"
CommentFileSizeAuthor
#3 fatal-error.jpg290.24 KBscottrouse

Comments

Alexander Matveev’s picture

The same problem.
When trying to add node form embed node form. Using Form Block, Content Taxonomy and Hierarchical Select.

ceejayoz’s picture

Subscribing. Happening for me as well with a content taxonomy field.

$part_of_form = _hierarchical_select_get_form_item($form, $name); in hierarchical_select.module appears to be returning false in my situation.

It is looking for field_record_schedule[tids] in the following array. Looks like it needs to be recursing into #post?

Array
(
    [#parameters] => Array
        (
            [0] => adops_record_node_form
            [1] => Array
                (
                    [storage] => 
                    [submitted] => 
                    [post] => Array
                        (
                        )

                )

            [2] => stdClass Object
                (
                    [type] => adops_record
                    [user] => stdClass Object
                        (
                            [uid] => 4
                            [name] => csternal
                            [pass] => 
                            [mail] => csternal@gannett.com
                            [mode] => 0
                            [sort] => 0
                            [threshold] => 0
                            [theme] => 
                            [signature] => 
                            [signature_format] => 0
                            [created] => 1279552439
                            [access] => 1279730087
                            [login] => 1279577168
                            [status] => 1
                            [timezone] => 
                            [language] => 
                            [picture] => 
                            [init] => 
                            [data] => a:2:{s:2:"dn";s:84:"CN=Sternal-Johnson\, Christopher,OU=Users,OU=Rochester,DC=us,DC=ad,DC=gannett,DC=com";s:18:"admin_compact_mode";b:1;}
                            [timezone_name] => 
                            [dn] => CN=Sternal-Johnson\, Christopher,OU=Users,OU=Rochester,DC=us,DC=ad,DC=gannett,DC=com
                            [admin_compact_mode] => 1
                            [roles] => Array
                                (
                                    [2] => authenticated user
                                    [3] => administrator
                                )

                            [profile_first_name] => Christopher
                            [profile_last_name] => Sternal-Johnson
                            [profile_phone] => (585) 258-2635
                            [profile_display_name] => Sternal-Johnson, Christopher
                            [realname] => Sternal-Johnson, Christopher
                            [realname_save] => csternal
                        )

                    [uid] => 4
                    [name] => csternal
                    [field_record_form] => Array
                        (
                            [0] => Array
                                (
                                    [nid] => 1
                                )

                        )

                    [status] => 1
                    [promote] => 
                    [sticky] => 
                    [created] => 1279730185
                    [revision] => 
                    [comment] => 0
                    [menu] => Array
                        (
                            [link_title] => 
                            [mlid] => 0
                            [plid] => 0
                            [menu_name] => primary-links
                            [weight] => 0
                            [options] => Array
                                (
                                )

                            [module] => menu
                            [expanded] => 0
                            [hidden] => 0
                            [has_children] => 0
                            [customized] => 0
                            [parent_depth_limit] => 8
                        )

                    [body] => 
                    [title] => 
                    [format] => 
                    [field_record_schedule] => 
                    [pathauto_perform_alias] => 1
                )

        )

    [#type] => form
    [#programmed] => 
    [#token] => adops_record_node_form
    [form_token] => Array
        (
            [#id] => edit-adops-record-node-form-form-token
            [#type] => token
            [#default_value] => ac5519450e0ce1945bacd372338c0ccf
            [#post] => Array
                (
                    [field_record_form] => Array
                        (
                            [nid] => Array
                                (
                                    [nid] => 1
                                )

                        )

                    [field_record_schedule] => Array
                        (
                            [tids] => Array
                                (
                                    [hsid] => 59
                                    [hierarchical_select] => Array
                                        (
                                            [selects] => Array
                                                (
                                                    [0] => 1
                                                )

                                        )

                                )

                        )

                    [field_record_position] => Array
                        (
                            [nid] => Array
                                (
                                    [nid] => 3
                                )

                        )

                    [menu] => Array
                        (
                            [link_title] => 
                            [parent] => primary-links:0
                            [weight] => 0
                        )

                    [hs_form_build_id] => hs_form_3d65bd94592a44fb3a82873db395d37a
                    [changed] => 
                    [form_build_id] => form-7fab435e740b7dff375785770271dfd9
                    [form_token] => ac5519450e0ce1945bacd372338c0ccf
                    [form_id] => adops_record_node_form
                    [log] => 
                    [comment] => 0
                    [pathauto_perform_alias] => 1
                    [name] => csternal
                    [date] => 
                    [status] => 1
                    [hsid] => 59
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => form_token
                )

            [#array_parents] => Array
                (
                    [0] => form_token
                )

            [#weight] => 0
            [#processed] => 
            [#description] => 
            [#attributes] => Array
                (
                )

            [#required] => 
            [#input] => 1
            [#name] => form_token
            [#value] => ac5519450e0ce1945bacd372338c0ccf
            [#needs_validation] => 1
            [#defaults_loaded] => 1
            [#sorted] => 1
        )

    [form_id] => Array
        (
            [#type] => hidden
            [#value] => adops_record_node_form
            [#id] => edit-adops-record-node-form
            [#post] => Array
                (
                    [field_record_form] => Array
                        (
                            [nid] => Array
                                (
                                    [nid] => 1
                                )

                        )

                    [field_record_schedule] => Array
                        (
                            [tids] => Array
                                (
                                    [hsid] => 59
                                    [hierarchical_select] => Array
                                        (
                                            [selects] => Array
                                                (
                                                    [0] => 1
                                                )

                                        )

                                )

                        )

                    [field_record_position] => Array
                        (
                            [nid] => Array
                                (
                                    [nid] => 3
                                )

                        )

                    [menu] => Array
                        (
                            [link_title] => 
                            [parent] => primary-links:0
                            [weight] => 0
                        )

                    [hs_form_build_id] => hs_form_3d65bd94592a44fb3a82873db395d37a
                    [changed] => 
                    [form_build_id] => form-7fab435e740b7dff375785770271dfd9
                    [form_token] => ac5519450e0ce1945bacd372338c0ccf
                    [form_id] => adops_record_node_form
                    [log] => 
                    [comment] => 0
                    [pathauto_perform_alias] => 1
                    [name] => csternal
                    [date] => 
                    [status] => 1
                    [hsid] => 59
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => form_id
                )

            [#array_parents] => Array
                (
                    [0] => form_id
                )

            [#weight] => 0.001
            [#processed] => 1
            [#description] => 
            [#attributes] => Array
                (
                )

            [#required] => 
            [#input] => 1
            [#process] => Array
                (
                    [0] => form_expand_ahah
                )

            [#name] => form_id
            [#defaults_loaded] => 1
            [#sorted] => 1
        )

    [#id] => adops-record-node-form
    [#description] => 
    [#attributes] => Array
        (
            [enctype] => multipart/form-data
        )

    [#required] => 
    [#tree] => 
    [#parents] => Array
        (
        )

    [#method] => post
    [#action] => /new/hierarchical_select_json
    [#post] => Array
        (
            [field_record_form] => Array
                (
                    [nid] => Array
                        (
                            [nid] => 1
                        )

                )

            [field_record_schedule] => Array
                (
                    [tids] => Array
                        (
                            [hsid] => 59
                            [hierarchical_select] => Array
                                (
                                    [selects] => Array
                                        (
                                            [0] => 1
                                        )

                                )

                        )

                )

            [field_record_position] => Array
                (
                    [nid] => Array
                        (
                            [nid] => 3
                        )

                )

            [menu] => Array
                (
                    [link_title] => 
                    [parent] => primary-links:0
                    [weight] => 0
                )

            [hs_form_build_id] => hs_form_3d65bd94592a44fb3a82873db395d37a
            [changed] => 
            [form_build_id] => form-7fab435e740b7dff375785770271dfd9
            [form_token] => ac5519450e0ce1945bacd372338c0ccf
            [form_id] => adops_record_node_form
            [log] => 
            [comment] => 0
            [pathauto_perform_alias] => 1
            [name] => csternal
            [date] => 
            [status] => 1
            [hsid] => 59
        )

    [#processed] => 
    [#defaults_loaded] => 1
    [#sorted] => 1
)
scottrouse’s picture

StatusFileSize
new290.24 KB

Same issue here on a node/add form.

Unsupported operand types in includes/common.inc on line 2886

scottrouse’s picture

A bit more investigating:

Thanks to a suggestion on IRC, I added if (!is_array($elements)) var_dump(debug_backtrace()); just above $elements += array('#title' => NULL, '#description' => NULL); on line 2887 of includes/common.inc (http://drupalbin.com/15434) and installed/enabled the Devel module.

When trying to use HS to select a taxonomy hierarchy on a node/add or node/edit form, I still get the "Received an invalid response from server" message. Here is the POST response output to Firebug with Devel enabled:


array(4) {
  [0]=>
  array(4) {
    ["file"]=>
    string(129) "/home/diesel/domains/dieseltunesperformancechips.com/public_html/sites/all/modules/hierarchical_select/hierarchical_select.module"
    ["line"]=>
    int(342)
    ["function"]=>
    string(13) "drupal_render"
    ["args"]=>
    array(1) {
      [0]=>
      &bool(false)
    }
  }
  [1]=>
  array(2) {
    ["function"]=>
    string(24) "hierarchical_select_json"
    ["args"]=>
    array(0) {
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(82) "/home/diesel/domains/dieseltunesperformancechips.com/public_html/includes/menu.inc"
    ["line"]=>
    int(348)
    ["function"]=>
    string(20) "call_user_func_array"
    ["args"]=>
    array(2) {
      [0]=>
      &string(24) "hierarchical_select_json"
      [1]=>
      &array(0) {
      }
    }
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(74) "/home/diesel/domains/dieseltunesperformancechips.com/public_html/index.php"
    ["line"]=>
    int(18)
    ["function"]=>
    string(27) "menu_execute_active_handler"
    ["args"]=>
    array(0) {
    }
  }
}
<br />
<b>Fatal error</b>:  Unsupported operand types in <b>/home/diesel/domains/dieseltunesperformancechips.com/public_html/includes/common.inc</b> on line <b>2887</b><br />

Not sure if that's helpful or not, but I'm getting pretty desperate here. Grateful for any help out there.

abaddon’s picture

@ScottRous , as per chat, ive enabled Hierarchical Select and Hierarchical Select Taxonomy, on an almost bare drupal 6 development site
created a test vocabulary, added 10 test terms to it in random hierarchy, checked to use Hierarchical Select for the vocabulary and used it on Page content types, everything else is default
i wasnt able to replicate this, the form works both in preview & node creation

i think theres some contrib module that spoils the form, if we can touch base on irc again ill try to help you debug

domidc’s picture

Same issue here when updating to latest version.

domidc’s picture

I found what was causing the problem in my installation. When updating to the latest version I also installed memcached for the installation (this my config which I have used on many sites before http://dominiquedecooman.com/blog/install-memcache-drupal-centos). I havent been able to track down the exact cause but disabling memcached, which works fine for the rest of the installation, makes the php error go away.
The thing is I counted on having memcached for performance. Probably some cached stuff doesnt get retrieved by hierarchical select from the memcahced bins but does make it when its stored in the database caching. I dont have the time right now to fix this issue so I ll have to manage with database caching. Probably next month or so maybe i ll have some time to fix this issues and find the cause. Maybe someone else could try in the meanwhile?

freeunited’s picture

domidc’s picture

The problem was indeed cache related. this issue http://drupal.org/node/538022#comment-3116204 explains. At #92 there is a patch that solved my problem.

wim leers’s picture

Status: Active » Closed (duplicate)

This is a duplicate, then. Thanks for tracking this down! :)