Vocabulary: Location

Terms:

Angola
UK - England - London
UK - England - Dorset
UK - Wales - Ceredigion
USA - Dallas - Dallas County
USA - Florida - Palm Beach County

Settings: Save Deepest Term Only

Create node, select: UK - Wales - Ceredigion

go to edit node, term data correctly saved and showing UK - Wales - Ceredigion

Alter Settings: Save Term Lineage

edit node, select UK - Wales - Ceredigion, save, edit. Go to edit node, terms showing

Angola

go to edit, alter to UK - Wales - Ceredigion again, save...go to edit, terms showing:

Angola

I am using the terms to automatically write both my URLs and title so this is creating a mess on my test site. Every time a user edits a node, if they didn't put the terms back as they were before, the title, URL and terms would change on submission.

Comments

wim leers’s picture

Assigned: Unassigned » wim leers

Uhm, you first say that you're using "save deepest term only", but in the title you say "save term lineage". Which is it now?

Transitions from one to the other are *not* supported, because the changes needed (especially from "save deepest term only" to "save term lineage) cannot be predicted.

What you are describing, sounds like a bug though. I will try to reproduce.

esllou’s picture

In my example, I start off with Save Deepest Term Only, to show that that's working as expected, then I add:

Alter Settings: Save Term Lineage

Also, I don't believe this is "only" a transitional problem. If I change from one setting to the other, I'd expect to see an issue when I FIRST go to edit a node, but this is happening, as shown in my example, repeatedly. I quote from my first post:

Alter Settings: Save Term Lineage

edit node, select UK - Wales - Ceredigion, save, edit. Go to edit node, terms showing

Angola

go to edit, alter to UK - Wales - Ceredigion again, save...go to edit, terms showing:

Angola

wim leers’s picture

I know this isn't just a transitional problem. I quote:

What you are describing, sounds like a bug though. I will try to reproduce.

esllou’s picture

OK, let me know if you want a hand with any testing.

esllou’s picture

having upgraded to latest version of the .module file (1.80), I tried again:

I save a node as UK >> England >> London and when I go into the same node to edit it, the terms are showing as:

Angola >> London

which is not even a parent/child relationship that exists! Again, with "save only deepest term", there are no problems, only with "save term lineage".

wim leers’s picture

Is this a "multiple parents" vocabulary?

wim leers’s picture

Also, please go to admin/settings/hierarchical_select/configs and export each different config. That makes it much easier to reproduce this. :)

esllou’s picture

It is multiple hierarchy vocabulary.

Here is the export:

$config = array(
  'config_id'       => 'taxonomy-13',
  'save_lineage'    => 0,
  'enforce_deepest' => 1,
  'node_count'      => 0,
  'level_labels' => array(
    'status' => 0,
    'labels' => array(
      0 => '',
      1 => '',
      2 => '',
    ),
  ),
  'dropbox' => array(
    'status' => 0,
    'title'  => '',
    'limit'  => ,
  ),
  'editability' => array(
    'status' => 0,
    'item_types' => array(
      0 => '',
      1 => '',
      2 => '',
    ),
    'allow_new_levels' => 0,
    'max_levels'       => 2,
  ),
);
esllou’s picture

were you able to reproduce this, Wim?

robin.com.au’s picture

I have an interest to see this problem solved.
I have a 3 level hierarchy: Country -> State -> City.
Eg. Australia -> Western Australia -> Perth

Choosing Save only the deepest term and Force the user to choose a term from the deepest level to force Perth to be chosen works fine.

However if I choose Save Term Lineage and Allow the user to choose a term from any level to have the ability to choose Western Australia without forcing to choose Perth, it doesn't work.

Whether you create new content or edit existing node, neither Western Australia nor Perth will stick, BUT Australia does.

And if I choose Save only the deepest term and Allow the user to choose a term from any level instead, no changes seems to happen.

And also I cannot understand the difference between Save lineage and Level Choice. It really sounds like the same thing to me and needs further clarification. Maybe a few examples with Country, State, City will help.

Thank you Wim,
Robin

esllou’s picture

...and just to complete the four possible choices, my set up that isn't working is

Save Lineage and Force the user to choose a term from the deepest level

The difference as I understand it, between Level Choice and Save Lineage is this:

Save Lineage - If you save a node with Perth and this option selected, the $terms on that node will be Australia, Western Australia AND Perth. If it's not selected, only Perth would get chosen. This is the part of HS which seems most buggy and the choices don't stick on node/edit.

Level Choice - Will you allow your users to Select Australia or perhaps Western Australia, or do they have to choose from the deepest level, i.e. Perth.

If you combine the two, you could have a user select Australia, then Western Australia (not having to go to deepest level) and the $terms would come out as Australia and Western Australia.

wim leers’s picture

Status: Active » Closed (duplicate)

I *think* this is a duplicate of http://drupal.org/node/258708. Please test and confirm. If that issue didn't fix it, then please mark this issue as active again, or I won't see it.

esllou’s picture

The problem of the lineage not being saved when you go into node/edit seems to have gone away but now it seems to be interfering with my PathAuto settings. I have the URL for this nodetype to be:

city/[termpath-raw]/[field_city_name-raw]

and before, when I had HS configured to "save deepest term only", the URL was created like this:

city/united-states/texas/dallas-county/dallas

now I've switched to "save term lineage", they are coming out as:

city/united-states/dallas

only taking the highest level of the termpath. When I edit and save again, it corrects itself.

esllou’s picture

just to confirm. Switched HS back to "Save only the deepest term" and the URLs are coming out right first time for newly created nodes - so the latest patch is doing something odd with the termpath.