From e0795d71bfc88f7056d63ec18c3f53791fbc3404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 12 Jun 2024 14:46:41 +0200 Subject: [PATCH 1/2] Refactor query variable names --- Editor.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Editor.php b/Editor.php index 7bdefc3..8737019 100644 --- a/Editor.php +++ b/Editor.php @@ -1596,25 +1596,25 @@ private function _ssp_query($query, $http) $this->_ssp_filter($query, $http); // Get the number of rows in the result set - $ssp_set_count = $this->_db + $ssp_set_count_query = $this->_db ->query('count') ->table($this->_read_table()) ->get($this->_pkey[0]); - $this->_get_where($ssp_set_count); - $this->_ssp_filter($ssp_set_count, $http); - $ssp_set_count->left_join($this->_leftJoin); - $ssp_set_count = $ssp_set_count->exec()->fetch(); + $this->_get_where($ssp_set_count_query); + $this->_ssp_filter($ssp_set_count_query, $http); + $ssp_set_count_query->left_join($this->_leftJoin); + $ssp_set_count = $ssp_set_count_query->exec()->fetch(); // Get the number of rows in the full set - $ssp_full_count = $this->_db + $ssp_full_count_query = $this->_db ->query('count') ->table($this->_read_table()) ->get($this->_pkey[0]); - $this->_get_where($ssp_full_count); + $this->_get_where($ssp_full_count_query); if (count($this->_where)) { // only needed if there is a where condition - $ssp_full_count->left_join($this->_leftJoin); + $ssp_full_count_query->left_join($this->_leftJoin); } - $ssp_full_count = $ssp_full_count->exec()->fetch(); + $ssp_full_count = $ssp_full_count_query->exec()->fetch(); return [ 'draw' => (int) $http['draw'], From 49fa1198819f50183b1f87893f1648308b30a309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 12 Jun 2024 15:17:10 +0200 Subject: [PATCH 2/2] revert hack for unsupported PHP 5.3 --- Editor.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Editor.php b/Editor.php index 8737019..7898e78 100644 --- a/Editor.php +++ b/Editor.php @@ -1631,10 +1631,8 @@ private function _ssp_query($query, $http) * @param int $index Index in the DataTables' submitted data * * @return string DB field name - * - * @private Note that it is actually public for PHP 5.3 - thread 39810 */ - public function _ssp_field($http, $index) + private function _ssp_field($http, $index) { $name = $http['columns'][$index]['data']; $field = $this->_find_field($name, 'name');