jenkins-bot has submitted this change and it was merged.

Change subject: Timespan attribute is now descriptive ("1 month", "2 weeks"), 
count  attribute set to -1 will show all records
......................................................................


Timespan attribute is now descriptive ("1 month", "2 weeks"), count 
attribute set to -1 will show all records

Change-Id: I2a49ab2d7024cc93c31b3bbb4a7313e581fd91ab
---
M ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php
1 file changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Robert Vogel: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php 
b/ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php
index 017865f..0354190 100644
--- a/ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php
+++ b/ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php
@@ -33,12 +33,12 @@
       'count' => 'COUNT(stats_term)'
     );
 
-    $iTimeSpan = 1;
+    $sTimeSpan = "1 month";
     if ( !empty( $aOptions['timespan'] ) ) {
-      $iTimeSpan = ( int )$aOptions['timespan'];
+      $sTimeSpan = $aOptions['timespan'];
     }
 
-    $sStartDate = wfTimestamp( TS_MW, strtotime( "-$iTimeSpan months" ) );
+    $sStartDate = wfTimestamp( TS_MW, strtotime( '-'.$sTimeSpan ) );
 
     $aConditions = array();
     $aConditions[] = "stats_ts >= $sStartDate";
@@ -50,10 +50,13 @@
 
     $aQueryOptions = array(
       'GROUP BY' => 'stats_term',
-      'LIMIT' => $aOptions['count'],
-      'ORDER BY' => 'COUNT(stats_term)'
+      'ORDER BY' => 'COUNT(stats_term) DESC'
     );
 
+    if ( $aOptions['count'] != -1 ) {
+      $aQueryOptions['LIMIT'] = $aOptions["count"];
+    }
+
     $oRes = $oDB->select(
         $aTables,
         $aFields,

-- 
To view, visit https://gerrit.wikimedia.org/r/322098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a49ab2d7024cc93c31b3bbb4a7313e581fd91ab
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_23
Gerrit-Owner: ItSpiderman <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to