- Issue created by @phenaproxima
- πΊπΈUnited States phenaproxima Massachusetts
Actually, I've discovered that the sorting code in the backend is kind of a mess and should be cleaned up before we roll a stable release. Tagging accordingly.
The DrupalCore and Recipes sources have some copypasta code to sort projects by title:
$sort = $query['sort'];
switch ($sort) {
case 'a_z':
usort($projects, fn($x, $y) => $x->title <=> $y->title);
break;
case 'z_a':
usort($projects, fn($x, $y) => $y->title <=> $x->title);
break;
}
This should use natural sorting (strnatcmp
) and be a static helper method in SortHelper, rather than copypasta.
Active
2.1
Code
Refactors an existing API or subsystem for consistency, performance, modularization, flexibility, third-party integration, etc. May imply an API change. Frequently used during the Code Slush phase of the release cycle.
Actually, I've discovered that the sorting code in the backend is kind of a mess and should be cleaned up before we roll a stable release. Tagging accordingly.