I found this here:

http://drupal.org/node/295188

this issue does exist because I've just seen it on a test site, which I only use to do test installs. I've never touched the database.

I'm stuck at update 6 and can't go to update 7. I'm trying to recall which version of HS was installed on that site...it was from about mid august so I think it was rc1 or rc2.

I keep getting:

Fatal error: Cannot unset string offsets in /home/mysite/public_html/testbed/sites/all/modules/hierarchical_select/hierarchical_select.install on line 181

Comments

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Postponed (maintainer needs more info)

Interesting problem.

    if (isset($config['node_count'])) {
      $config['entity_count'] = $config['node_count'];
      unset($config['node_count']);
      db_query("UPDATE {variable} SET value = '%s' WHERE name = '%s'", serialize($config), $config_id);
    }

The third line is line 181.

As you can see, I did check properly if this key existed. I don't know how this can go wrong. Which PHP version are you on?

esllou’s picture

5.2.6

if you tell me what to look for in the db, I can go and check and do some testing. I did have a look in the relevant file, hierarchical_select.install...it seems to be doing some query for the variables table, right?

maybe I should just uninstall and do a fresh install of HS. I presume that wouldn't affect the taxonomy settings for existing nodes.

wim leers’s picture

Well, you could definitely live without that specific update. All it does, as its comment says is: "Rename 'node_count' to 'entity_count'."

If you've enabled the count setting anywhere, you'll have to reconfigure it. That's it. Probably less work to reconfigure that than to reinstall HS.

The strange thing is that I don't get that error… I'm on PHP 5.2.3.

esllou’s picture

it's probably a one-in-a-million combination of things, which is why I'm only the second person to ever mention it in the HS issue queue.

so can you just explain what I'd need to do. Where does this "node count" variable exist and what will I have to change?

at the moment, I've got big red warning signs on the admin page and on the status page so I'd like to clear this up.

esllou’s picture

I did a search in the variables table and found 18 lines where hs_config appeared. It's odd, some have entity_count in the value:

a:7:{s:9:"config_id";s:10:"taxonomy-2";s:12:"save_lineage";s:1:"0";s:15:"enforce_deepest";s:1:"0";s:12:
"level_labels";a:2:{s:6:"status";i:0;s:6:"labels";a:3:{i:0;s:0:"";i:1;s:0:"";i:2;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:3:{i:0;s:0:"";i:1;s:0:"";i:2;s:0:"";}s:16:"allow_new_levels";i:0;s:10:
"max_levels";s:1:"2";}s:12:"entity_count";s:1:"0";}

and others have node_count:

a:6:{s:9:"config_id";s:28:"views-taxonomy-CityGroups-13";s:12:"save_lineage";s:1:"1";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:3:{i:0;s:0:"";i:1;s:0:"";i:2;s:0:"";}}s:7:
"dropbox";a:3:{s:6:"status";i:1;s:5:"title";s:0:"";s:5:"limit";s:1:"0";}}
wim leers’s picture

Then that means the update hook was applied on SOME of them but failing at some point and then stopping.

This still doesn't explain *why* it's happening though. And as you suggest, we may never find out… So, I'd suggest you either update these manually in the database, or leave them as is and reconfigure the entity_count setting where you enabled it. Finally, update the module's db schema version in the {system} table.

esllou’s picture

as far as I remember, I went to update.php and number 5 was showing and when I ran it, I got the error message, so maybe it tried to do update 7 and failed halfway through. Now, when I go to update.php, I get 7 showing, not 5, so it seems 5 and 6 ran ok.

what do you mean by this:

"...or leave them as is and reconfigure the entity_count setting where you enabled it."

apart from trying to upgrade to rc6, I haven't done anything else on that test site. Are you talking about some HS setting on the admin side?

wim leers’s picture

By that, I meant that you could just set the db revision manually: pretend as if the update had worked. Then, you could just go to the config forms of the HS configs where you had enabled the node_count setting. So yes, the admin side.

I think this issue is sort-of resolved now? I can't really fix it since we don't know what's causing this.

esllou’s picture

since upgrading to RC6, I went into a vocabulary that previously used HS and all the HS options at the bottom of that vocab's page had disappeared. I had to go into modules and select Hierarchical Select Taxonomy for it to appear. Is that something that's been added?

Now when I go into the sitewide HS config page, that vocabulary shows "entity count - yes" even though the vocabulary configuration has "Display the node count: disabled".

esllou’s picture

I've just done some clicking around on my main site and it seems that the "node/entity count" flag on the HS "implementations" page isn't working at all. It always shows "Yes" whether it's actually enabled or not. Changing that setting does change whether you see the node count in brackets or not, but it always shows Yes on the implementations page. Just a heads up for you.

and it also means, when you tell me to manually alter it...it didn't need altering as node count was disabled, though that implementations page is telling me it's enabled.

wim leers’s picture

Status: Postponed (maintainer needs more info) » Fixed

since upgrading to RC6, I went into a vocabulary that previously used HS and all the HS options at the bottom of that vocab's page had disappeared. I had to go into modules and select Hierarchical Select Taxonomy for it to appear. Is that something that's been added?

No, that hasn't changed at all. You must have accidentally disabled HS Taxonomy.

Now when I go into the sitewide HS config page, that vocabulary shows "entity count - yes" even though the vocabulary configuration has "Display the node count: disabled".

That's the "Implementations" tab, in which you can see which features are supported by each implementation. It doesn't show any configured settings.
I guess that wasn't clear enough because it had you confused. So I just added some usage guidelines at the top of that page. You'll get it in the tarball or in RC7.

I've just done some clicking around on my main site and it seems that the "node/entity count" flag on the HS "implementations" page isn't working at all. It always shows "Yes" whether it's actually enabled or not. Changing that setting does change whether you see the node count in brackets or not, but it always shows Yes on the implementations page. Just a heads up for you.

See the above :)

and it also means, when you tell me to manually alter it...it didn't need altering as node count was disabled, though that implementations page is telling me it's enabled.

And once more: see the above :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.