I have a three level hierarchy which I'm trying to use HS with content taxonomy. I can get the deepest level to work but when I configure HS to 'Save term lineage' and Save options as 'Save as tag' or 'Both', I get this error.

* warning: Illegal offset type in /Applications/MAMP/htdocs/sites/all/modules/hierarchical_select 2/modules/hs_content_taxonomy.module on line 294.
* warning: Illegal offset type in /Applications/MAMP/htdocs/sites/all/modules/hierarchical_select 2/modules/hs_content_taxonomy.module on line 294.

Any thoughts much appreciated.

Comments

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Fixed

When you configure it to save the lineage, you must enable the "multiple values" field setting.

And please upgrade to version 3 beta 2, it will handle this automatically :)

humanoid’s picture

I have the same problem. I'm using the 5.x-3.x-dev (2008-Jul-07), Drupal 5.7, and I have enable the "multiple values" by activating "Lineage setting" and "enable Dropbox". The error appears after saving and the selected values are not saved:

* warning: Illegal offset type in .../modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.
* warning: Illegal offset type in .../modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293.

Also, the widget is not working anymore without using content-taxonomy as a general replacement for the taxonomy-selection as I had this before. After upgrading to beta2 the regular taxonomy selectbox is shown. I've run update.php and also completely removed the module and installed it again.

I'm looking forward to see this work, it's a great module. Thanks for that so long!
Jürgen

humanoid’s picture

Status: Fixed » Active

hmpf... sorry just wanted to set ticket to active

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

Please go through these steps:

Before you submit any issues, go through these steps:
1) go to Adminster > Logs > Status report (admin/logs/status) to check if your Hierarchical Select installation doesn't detect problems
2) read the "Troubleshooting" section of README.txt
3) read UPGRADE.txt if you have problems after upgrading from version 2 to version 3

mistresskim’s picture

StatusFileSize
new78.9 KB
new79.94 KB
new96.55 KB

Thanks for fast response. Upgraded to 5.x-3.0-beta2 without any log errors or problems, but I'm still getting the illegal offset error.

Screenshots attached of the settings for the vocabulary, the field and the HS config of the field. Let me know if anything looks weird.

wim leers’s picture

You did not associate the vocabulary with the same node type twice, did you (once through Taxonomy, once through Content Taxonomy).

mistresskim’s picture

Not sure what you mean. Is the above a question? :)

In taxonomy I have associated the vocabulary with the node type World Event. Then in the World Event settings I have a field which uses HS to select from the taxonomy. Is that wrong?

wim leers’s picture

That's very wrong.

It must be either one, not both. Consult the Content Taxonomy documentation.

mistresskim’s picture

Ah right. That makes sense. I've unassociated World Event with the Location taxonomy but I'm still getting the error. I will reinstall Content Taxonomy and see what happens.

humanoid’s picture

I've gone to these 3 steps, everything should be ok. I've also
1) removed the "Use the Hierarchical Select form element for this vocabulary." Option -> When saving the content taxonomie still the Illegal offset type error occurs.
2) removed the vocabular from this content type > Also When saving the content taxonomie still the Illegal offset type error occurs.

Also
I remember before I was playing with the regular taxonomy select and after updating from 3.x dev to 3.0 beta2 at the weekend, the Hierarchical Select form don't shown anymore but the regular form of the taxonomy selection. There were also some confusion because of the different modules, both of this versions where shown within admin/build/modules. Because of that I deactivated and later deleted the whole module before uploading and activating the latest version again. But the config data was still the same. Maybe there ist some wrong config data still saved ?

best regards & thanks for your help!
Jürgen

mistresskim’s picture

Installed Content Taxonomy again, deleted old Place field on World Event type, then made another one and configured it for HS, but I can still only get the deepest option to work. Full lineage still gives me the offset error. Wim, is there anything else I should do?

sonden’s picture

Subscribing

mistresskim’s picture

Managed to get this working properly just by chance and doing things in a different order.

Following Wim's advice I unassigned my content type from the vocabulary on the Location vocabulary page. Also for the general HS settings on the Location vocab page, this time I chose "Save only the deepest term".

Before I could not select the 'Multiple Values' option in the Data Settings when editing my Place field, but after changing the vocab page as above, I was able to do this.

Finally on the HS configuration for the Place field, I chose the "Save term lineage" in order to get all three levels of my hierarchy displayed.

And bingo, it worked! :)

Anyway, attached are new screenshots with the correct settings that worked for me. Maybe of use to others who are stuck.

summit’s picture

Hi Wim,

I also have this error...the error was gone by doing: http://drupal.org/node/234622#comment-889836 to hs_content_taxonomy.module.

Altering line 293

$keys[$node_field['tids']] = $node_field['tids'];

to:

$keys[$node_field['tids'][0]] = $node_field['tids'][0]; 

But now the terms as tags are not altered or saved anymore :(:(
Hopefully helpful adding to this discussion.

I have to rollback the whole module now, while I am going on vacations.
Wim good luck with finding a solution and after holidays I report me back!

Greetings,
Martijn

wim leers’s picture

Version: 5.x-2.2 » 5.x-3.x-dev

I still can't reproduce this. I'll need Drupal admin + FTP/SSH access to figure out why this is happening.

wim leers’s picture

I think this is because of the save_lineage setting. This setting *requires* that you have the "multiple values" setting checked. The HS config form does this automatically for you, but only since a certain revision of only a couple of weeks ago. If you haven't saved your settings in the mean time, it will not have been set automatically yet.

So, please save the HS config form for that field one more time.

summit’s picture

Hi Wim,

I am on holidays now in Spain, but would very much like to respond though I am not able to test thoroughly.
I have "save only the deepest" setting on and not the save_lineage setting..could that alter things?

Greetings,
Martijn

wim leers’s picture

How did you configure these 2 settings:
- HS dropbox
- content_taxonomy field "multiple values" setting

summit’s picture

I checked both I know. But am unable to look now, because my internet is to slow to go to admin, sorry..

greetings,
Martijn

wim leers’s picture

Please export both your HS config and the CCK field and post it here.

summit’s picture

Hi Wim,

After several tries on this slow internet I got them!
The content_taxonomy:

$config = array(
  'config_id'       => 'content-taxonomy-field_hs_taxo_regio_diepste',
  'save_lineage'    => 0,
  'enforce_deepest' => 0,
  'node_count'      => 0,
  'level_labels' => array(
    'status' => 0,
    'labels' => array(
      0 => '',
      1 => '',
      2 => '',
      3 => '',
    ),
  ),
  'dropbox' => array(
    'status'    => 1,
    'title'     => '',
    'limit'     => 0,
    'reset_hs'  => 1,
  ),
  'editability' => array(
    'status' => 1,
    'item_types' => array(
      0 => '',
      1 => '',
      2 => '',
      3 => '',
    ),
    'allow_new_levels' => 1,
    'max_levels'       => 3,
  ),
);
/code>

And the normal taxonomy:
<code>
$config = array(
  'config_id'       => 'taxonomy-138',
  'save_lineage'    => 0,
  'enforce_deepest' => 0,
  'node_count'      => 0,
  'level_labels' => array(
    'status' => 0,
    'labels' => array(
      0 => '',
      1 => '',
      2 => '',
      3 => '',
      4 => '',
    ),
  ),
  'dropbox' => array(
    'status'    => 1,
    'title'     => '',
    'limit'     => 0,
    'reset_hs'  => 1,
  ),
  'editability' => array(
    'status' => 1,
    'item_types' => array(
      0 => '',
      1 => '',
      2 => '',
      3 => '',
      4 => '',
    ),
    'allow_new_levels' => 1,
    'max_levels'       => 4,
  ),
);

Thanks for going into this and greetings from Spain!
Martijn

wim leers’s picture

I'm afraid you forgot to export your CCK field… I really need that :)

And have a good time there in Spain! Where exactly in Spain are you btw?

summit’s picture

Hi Wim,

I am in Aguilas, near Lorca/Murcia in Spain, very hot..sitting now outsite with wifi.
Slow internet, but succeeded hopefully with the CCK field settings which you asked for:

$content[type]  = array (
  'name' => 'Page',
  'type' => 'page',
  'description' => 'If you want to add a static page, like a contact page or an about page, use a page.',
  'title_label' => 'Title',
  'body_label' => 'Body',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'image_attach' => 0,
  'image_attach_size_teaser' => 'thumbnail',
  'image_attach_weight_teaser' => 0,
  'image_attach_size_body' => 'thumbnail',
  'image_attach_weight_body' => 0,
  'nodeasblock' => 1,
  'upload' => 1,
  'old_type' => 'page',
  'orig_type' => 'page',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'taxonomy_context_inline' => 0,
  'taxonomy_context_breadcrumb' => 0,
  'feedapi' => 
  array (
    'enabled' => '',
    'refresh_on_create' => 0,
    'update_existing' => 1,
    'skip' => 0,
    'items_delete' => 0,
    'parsers' => 
    array (
      'parser_xmlfetch' => 
      array (
        'enabled' => false,
        'weight' => 0,
      ),
      'parser_simplepie' => 
      array (
        'enabled' => false,
        'weight' => 0,
      ),
      'parser_common_syndication' => 
      array (
        'enabled' => false,
        'weight' => 0,
      ),
    ),
    'processors' => 
    array (
      'feedapi_node' => 
      array (
        'enabled' => '',
        'weight' => 0,
        'content_type' => 'story',
        'node_date' => 'feed',
        'promote' => 3,
        'x_dedupe' => 0,
      ),
      'feedapi_inherit' => 
      array (
        'enabled' => '',
        'weight' => 0,
        'inherit_taxonomy' => true,
      ),
      'feedapi_aggregator' => 
      array (
        'enabled' => '',
        'weight' => 0,
        'block' => 3,
        'categories' => 
        array (
        ),
      ),
    ),
  ),
  'xmlsitemap_node_type_priority' => 0.1,
  'xmlsitemap_old_priority' => 0.1,
);
$content[fields]  = array (
  0 => 
  array (
    'widget_type' => 'content_taxonomy_hs',
    'label' => 'Regionaal',
    'weight' => '-3',
    'description' => '',
    'group' => false,
    'required' => '0',
    'multiple' => NULL,
    'save' => 'tag',
    'vid' => '138',
    'tid' => '0',
    'depth' => '4',
    'field_name' => 'field_hs_taxo_regio_diepste',
    'field_type' => 'content_taxonomy',
    'module' => 'content_taxonomy, hs_content_taxonomy',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'hidden',
      ),
      'teaser' => 
      array (
        'format' => 'hidden',
      ),
      'full' => 
      array (
        'format' => 'hidden',
      ),
    ),
  ),
);

Thanks again for going into this!

Greetings,
Martijn

bennos’s picture

Changing the Lines from Comment http://drupal.org/node/279912#comment-919805
worked for me.

Currently it is not been fixed in the CVS.

bennos

summit’s picture

Hi Wim,

Just back from Spain, any progress in this field please?
Thanks in advance for your reply!

greetings,
Martijn

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

I think and – especially this – *hope* that this is a duplicate of http://drupal.org/node/283397. See http://drupal.org/node/283397#comment-955019 to find out why I really really hope this…