Wrong term order

Apr 6, 2012 at 5:05 PM
Edited Apr 6, 2012 at 5:08 PM
Name  
<input name="Terms[0].Id" type="hidden" value="41" /> <input name="Terms[0].IsChecked" type="checkbox" value="true" /> 1 Edit | Move
<input name="Terms[1].Id" type="hidden" value="47" />     <input name="Terms[1].IsChecked" type="checkbox" value="true" /> 1.1.1 Edit | Move
<input name="Terms[2].Id" type="hidden" value="45" />   <input name="Terms[2].IsChecked" type="checkbox" value="true" /> 1.2 Edit | Move
<input name="Terms[3].Id" type="hidden" value="48" />     <input name="Terms[3].IsChecked" type="checkbox" value="true" /> aaaaaaaaaaa 1.2.1 Edit | Move
<input name="Terms[4].Id" type="hidden" value="46" />   <input name="Terms[4].IsChecked" type="checkbox" value="true" /> 1.3 Edit | Move
<input name="Terms[5].Id" type="hidden" value="44" />   <input name="Terms[5].IsChecked" type="checkbox" value="true" /> aaaaaaaaaaaa 1.1 Edit | Move
<input name="Terms[6].Id" type="hidden" value="49" />     <input name="Terms[6].IsChecked" type="checkbox" value="true" /> 1.3.1 Edit | Move
<input name="Terms[7].Id" type="hidden" value="42" /> <input name="Terms[7].IsChecked" type="checkbox" value="true" /> 2 Edit | Move
<input name="Terms[8].Id" type="hidden" value="43" /> <input name="Terms[8].IsChecked" type="checkbox" value="true" /> 3 Edit | Move


In the table above, the last numbers in name indicate tree path.

The list of terms is wrong ordered, and the problem is in TermAdmin/index.cshtml line 36:

 @foreach ( var termEntry in Model.Terms) { ...

It can be fixed in controller by pre-order termpart in proper order, or in cshtml.

It is allready fixed on dev branch ? or should i try to fix it ?

Apr 25, 2012 at 2:36 PM

I think its from the taxonomy service itself i fixed this in method GetTerms by adding this

Original :

public IEnumerable<TermPart> GetTerms(int taxonomyId) {
            return _contentManager.Query<TermPartTermPartRecord>().Where(x => x.TaxonomyId == taxonomyId).List().OrderBy(t => t);
        }
Fixed : 
public IEnumerable<TermPart> GetTerms(int taxonomyId) {
            return _contentManager.Query<TermPartTermPartRecord>().Where(x => x.TaxonomyId == taxonomyId).List().OrderBy(t => t.FullPath);
        }

Note :this is for V1.3