An example :

http://wimleers.com/demo/hierarchical-select/taxonomy
More specifically the ' Places I've visited: *' example. If you select new items the items in the list below get sorted immediately. This is a behaviour that is unwanted in our case and I was wondering if it was possible to disable that behaviour?

I'm going to try and look into the code now and if I find it I'll post a patch.

Comments

wim leers’s picture

Component: Miscellaneous » Code
Priority: Normal » Minor

It's caused by line 1998 in the function _hierarchical_select_dropbox_generate():
usort($dropbox->lineages, '_hierarchical_select_dropbox_sort');

I guess I could make this yet another setting. But do remember that it *will* be sorted when editing a saved node (in the case of taxonomy).

nick_vh’s picture

Not quite..

That is one cause but not completely

_hierarchical_select_dropbox_reconstruct_lineages_save_lineage_enabled Here it get's sorted as well I notice (still looking)

Editing a saved node is less important for now.

wim leers’s picture

Hah, I looked over that indeed :) But I was just trying to get you started ;) :)

nick_vh’s picture

Any hint on where to find the sorting when editing a saved node? Almost there with a patch (not saying it's completely fool-proof but it works)

//hmmz, maybe bad question... that's taxonomy itself that arranges that...

Can I fill in default values? Like saying start the page with that and that value in that order? Manually in the settings array?
So basically I want to override the values that he loads and put in mine.

//ok no need to answer - taxonomy is taxonomy (so depends on the taxonomy array..)

wim leers’s picture

You answered everything yourself already :)

wim leers’s picture

Status: Active » Closed (duplicate)

Not sure why you've created a separate issue for the accompanying patch, but you did. So, this is a duplicate of #466828: Disable the automatic sort in Hierarchical Select.