From eee5eee90fe3814b7c60d89dd48d59e148ddb7c8 Mon Sep 17 00:00:00 2001 From: Daniel Barreto Date: Wed, 18 Feb 2015 17:42:52 -0500 Subject: [PATCH] Fix, session list order and limit conditions - refs BT#9092 --- .../src/AdvancedSubscriptionPlugin.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.php b/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.php index c136549c8f..df4f303a10 100644 --- a/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.php +++ b/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.php @@ -852,22 +852,19 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface /** * List all session (id, name) for select input - * @param int $length + * @param int $limit * @return array */ - public function listAllSessions($length = 100) + public function listAllSessions($limit = 100) { - $length = intval($length); + $limit = intval($limit); $sessionTable = Database::get_main_table(TABLE_MAIN_SESSION); $columns = 'id, name'; $conditions = array(); - if ($length > 0) { + if ($limit > 0) { $conditions = array( - 'order' => array( - 'BY name LIMIT ?' => array( - $length - ) - ) + 'order' => 'name', + 'limit' => $limit, ); }