Oddly, JS may pass false as a string (@todo)

This commit is contained in:
Samuel Georges 2016-02-20 17:15:21 +11:00
parent da71a21172
commit 202e542985
1 changed files with 8 additions and 1 deletions

View File

@ -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()
];
}