Closed (duplicate)
Project:
Hierarchical Select
Version:
6.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Mar 2009 at 08:08 UTC
Updated:
22 Jul 2009 at 17:41 UTC
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
Comment #1
wim leersIt'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).
Comment #2
nick_vhNot 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.
Comment #3
wim leersHah, I looked over that indeed :) But I was just trying to get you started ;) :)
Comment #4
nick_vhAny 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..)
Comment #5
wim leersYou answered everything yourself already :)
Comment #6
wim leersNot 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.