Merge pull request #15610 from uberbrady/fix_numeric_sort_bug

Fix numeric sort 'ambiguous order clause' error
This commit is contained in:
snipe 2024-10-03 14:34:00 +01:00 committed by GitHub
commit 3699d79363
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -395,7 +395,7 @@ class AssetsController extends Controller
// This may not work for all databases, but it works for MySQL // This may not work for all databases, but it works for MySQL
if ($numeric_sort) { if ($numeric_sort) {
$assets->orderByRaw($sort_override . ' * 1 ' . $order); $assets->orderByRaw(DB::getTablePrefix() . 'assets.' . $sort_override . ' * 1 ' . $order);
} else { } else {
$assets->orderBy($sort_override, $order); $assets->orderBy($sort_override, $order);
} }