From 202e54298537a5f81dc2d63c2e0951b01bc349d5 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 20 Feb 2016 17:15:21 +1100 Subject: [PATCH] Oddly, JS may pass false as a string (@todo) --- modules/backend/widgets/Table.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/backend/widgets/Table.php b/modules/backend/widgets/Table.php index aa882cdba..34fd031a9 100644 --- a/modules/backend/widgets/Table.php +++ b/modules/backend/widgets/Table.php @@ -192,8 +192,15 @@ class Table extends WidgetBase throw new SystemException('The Table widget is not configured to use the server data source.'); } + $count = post('count'); + + // Oddly, JS may pass false as a string (@todo) + if ($count === 'false') { + $count = false; + } + return [ - 'records' => $this->dataSource->getRecords(post('offset'), post('count')), + 'records' => $this->dataSource->getRecords(post('offset'), $count), 'count' => $this->dataSource->getCount() ]; }