You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the FolderTypeCreator sorts assets by folder first (line 163), in doing so it first saves the current order-by list then clears all other sorts to add a group sort by folder. However, if there is an existing grouped sort, such as as one set by the fluent module (tractorcow-farm/silverstripe-fluent#208), then this will get the same index (eg both sorts get _SortColumn0 as their identifier and as a result, only the folder sort remains.
To reproduce:
install the fluent module and add the FluentVersionedExtension to File, make sure that 'Name' is in the localised fields. This will mean the default sort on Name will become a group sort. This leads to unstable sorting as the 'Name' sort is removed when the folder sort is applied.
Unless it is changed from a group filter I think the problem will still exist. The issue is that all filters are removed by the sort call and re-added. If a group query is included it is moved into the column select and given an index (SQLSelect.php line 360). So removing and adding messes up the index count and you get two _SortColumn0 criteria.
I've reviewed #844 which is great and fixed this bug. silverstripe/silverstripe-assets#166 seems related but not coupled to this issue, so I'm going to close this issue now - I've left some comments on that PR which can be discussed separately
Currently the
FolderTypeCreator
sorts assets by folder first (line 163), in doing so it first saves the current order-by list then clears all other sorts to add a group sort by folder. However, if there is an existing grouped sort, such as as one set by the fluent module (tractorcow-farm/silverstripe-fluent#208), then this will get the same index (eg both sorts get_SortColumn0
as their identifier and as a result, only the folder sort remains.To reproduce:
install the fluent module and add the
FluentVersionedExtension
toFile
, make sure that 'Name' is in the localised fields. This will mean the default sort on Name will become a group sort. This leads to unstable sorting as the 'Name' sort is removed when the folder sort is applied.PRs
The text was updated successfully, but these errors were encountered: