HS exported configuration is invalid PHP code

esllou - May 27, 2009 - 05:51
Project:Hierarchical Select
Version:5.x-3.0-rc7
Component:Code - Taxonomy
Category:bug report
Priority:normal
Assigned:Wim Leers
Status:closed
Description

I have two identical configs of HS on two sites but on one of them, when I open the select dropdown list, the one term in the vocabulary that has many child items...there is no arrow, no child items shown.

status report shows HS without problems. I have HS and HS taxonomy modules enabled.

what would be the reason that HS just doesn't see the child items. When I go into the "List Terms" in the vocabulary, all the child items are there.

here is my config:

$config = array(
  'config_id'       => 'taxonomy-9',
  'save_lineage'    => 0,
  'enforce_deepest' => 1,
  'entity_count'    => 0,
  'resizable'       => 1,
  'level_labels' => array(
    'status' => 0,
    'labels' => array(
      0 => '',
      1 => '',
    ),
  ),
  'dropbox' => array(
    'status'    => 0,
    'title'     => '',
    'limit'     => 0,
    'reset_hs'  => 1,
  ),
  'editability' => array(
    'status' => 0,
    'item_types' => array(
      0 => '',
      1 => '',
    ),
    'allowed_levels' => array(
      0 => 0,
      1 => 0,
    ),
    'allow_new_levels' => 0,
    'max_levels'       => 2,
  ),
);

#1

esllou - May 27, 2009 - 06:13

there seems to be a few differences between what are supposedly identical rc7 HS modules between two sites.

1. when I try and import this from the "good" site to the "bad", it says there's a syntax error even though I'm copying straight from the export text box:

$config = array(
  'config_id'       => 'taxonomy-9',
  'save_lineage'    => 0,
  'enforce_deepest' => 1,
  'entity_count'    => 0,
  'resizable'       => 1,
  'level_labels' => array(
    'status' => 0,
    'labels' => array(
      0 => '',
      1 => '',
      2 => '',
    ),
  ),
  'dropbox' => array(
    'status'    => 0,
    'title'     => '',
    'limit'     => ,
    'reset_hs'  => 1,
  ),
  'editability' => array(
    'status' => 0,
    'item_types' => array(
      0 => '',
      1 => '',
      2 => '',
    ),
    'allowed_levels' => array(
      0 => 1,
      1 => 1,
      2 => 1,
    ),
    'allow_new_levels' => 0,
    'max_levels'       => 2,
  ),
);

you can see there are a couple of extra lines.

When I go into config for the site that isn't seeing the child items, I get options to alter level labels, etc that I don't have on the other site. I've attached two images.

Am I missing something obvious? HS just seems to be acting up on the one site and working perfectly on the other. Both rc7.

AttachmentSize
good.gif 8.94 KB
bad.gif 13.04 KB

#2

Wim Leers - May 27, 2009 - 10:48
Title:HS is not seeing child items» HS exported configuration is invalid PHP code
Assigned to:Anonymous» Wim Leers

The exported value for "limit" is invalid. I'll have to look into that. Thanks for reporting!

#3

esllou - May 27, 2009 - 13:28

any ideas why a multiple-hierarchy vocabulary is not showing up its child items at all?

#4

esllou - May 27, 2009 - 15:36

Wim, I think I've solved this and the problem, as you have probably realised, was definitely in the hs_config stuff in the variables table.

I ended up over-writing this:

a:8:{s:9:"config_id";s:10:"taxonomy-9";s:12:"save_lineage";s:1:"0";s:15:"enforce_deepest";s:1:"1";s:12:"entity_count";s:1:"0";s:9:"resizable";s:1:"1";s:12:"level_labels";a:2:{s:6:"status";i:0;s:6:"labels";a:2:{i:0;s:0:"";i:1;s:0:"";}}s:7:"dropbox";a:4:{s:6:"status";i:0;s:5:"title";s:0:"";s:5:"limit";s:1:"0";s:8:"reset_hs";s:1:"1";}s:11:"editability";a:5:{s:6:"status";i:0;s:10:"item_types";a:2:{i:0;s:0:"";i:1;s:0:"";}s:14:"allowed_levels";a:2:{i:0;i:0;i:1;i:0;}s:16:"allow_new_levels";i:0;s:10:"max_levels";s:1:"2";}}

with this, same vocabulary, but from a db backup from a week ago that I made with, I think, rc3 or rc4. All of the stuff extra from the bad.gif image I attached has now disappeared, the drag bar image is appearing, so is the arrow image for the child items, and I'm able to select child items. I *think* this resolves the problem but I'll do some testing today.

a:7:{s:9:"config_id";s:10:"taxonomy-9";s:12:"save_lineage";s:1:"0";s:15:"enforce_deepest";s:1:"1";s:10:"node_count";s:1:"0";s:12:"level_labels";a:2:{s:6:"status";i:0;s:6:"labels";a:2:{i:0;s:0:"";i:1;s:0:"";}}s:7:"dropbox";a:4:{s:6:"status";i:0;s:5:"title";s:0:"";s:5:"limit";s:1:"0";s:8:"reset_hs";s:1:"1";}s:11:"editability";a:4:{s:6:"status";i:0;s:10:"item_types";a:2:{i:0;s:0:"";i:1;s:0:"";}s:16:"allow_new_levels";i:0;s:10:"max_levels";s:1:"2";}}

I hope this config code is useful to you to know what went wrong in the installation. Here is what I did differently on the "good" and "bad" sites.

good - (posted issue about this last week, remember?) Installed rc7, site choked and spat out error message about update 7 not going through. Went into db and altered all node_count to entity_count. Seemed OK from there.

bad - decided to do something to prevent that happening. Wiped all hs_config entries from variables table. Installed rc7. Created one hs config on the admin side....same settings as that vocabulary had before. Had the problem I detailed in this thread. Only be replacing the hs_config code in the db with the saved hs_config code from a pre-rc7 installation was I able to get it working. So what's the issue: brand new hs_configs made with rc7? Don't know....

#5

Wim Leers - July 18, 2009 - 10:32
Status:active» closed

No, new configs with RC7 work fine because they've been working for a *very* long time and you're the only one to report this. Since you're the only one with this problem, I'm going to assume this was an isolated case.

Anybody: feel free to reopen if you have the same problem.

 
 

Drupal is a registered trademark of Dries Buytaert.