We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f0638a commit 094d69dCopy full SHA for 094d69d
src/controllers/InventoryController.php
@@ -254,6 +254,25 @@ public function actionInventoryLevelsTableData(): Response
254
$field = $sort[0]['sortField'];
255
$direction = $sort[0]['direction'];
256
257
+ // Validate the sorting inputs
258
+ if (!in_array($direction, ['asc', 'desc']) ||
259
+ !in_array($field, [
260
+ 'item',
261
+ 'sku',
262
+ 'reservedTotal',
263
+ 'damagedTotal',
264
+ 'safetyTotal',
265
+ 'qualityControlTotal',
266
+ 'committedTotal',
267
+ 'availableTotal',
268
+ 'onHandTotal',
269
+ 'incomingTotal',
270
+ ])) {
271
+
272
+ $field = null;
273
+ $direction = null;
274
+ }
275
276
if ($field && $direction) {
277
if ($field == 'sku') {
278
$field = 'purchasables.sku';
0 commit comments