ONEFORALL - Group sorting bug

DarkViper

If it is certain that 'f.value' contains a number (integer), it is easier to evaluate this value in the sorting as a number.
This can be achieved with the SQL function CAST(expression AS datatype)'.

  .'ORDER BY CAST(`f`.`value` AS UNSIGNED) '.$group_order.', `i`.`position` '.$position_order.$limit_sql;

see:
https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html#function_cast (function cast and description of types in function convert)
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

CodeALot

You're the best. That solved it. MANY thanks!

dbs

Hi, try this. Find in view_overview.php the block.
// If a group field is defined order by group and position

Last line of this block is
          .'ORDER BY `f`.`value` '.$group_order.', `i`.`position` '.$position_order.$limit_sql;

Change it to
          .'ORDER BY LENGTH(`f`.`value`), `f`.`value` '.$group_order.', `i`.`position` '.$position_order.$limit_sql;

Only this is added:
LENGTH(`f`.`value`),
Hope it helps.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

CodeALot

If you use field type GROUP in OneForAll and SHOW GROUP HEADERS on, SORT BY GROUP on, the sorting goes wrong once you use more than 10 groups.
Sorting is done like:

1
10
11
2
3
4
5 --- etc.

Does anyone have a brilliant idea how to solve this?