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

Change subject: Fix typo causing sql error
......................................................................


Fix typo causing sql error

If doing ordermethod=popularity on a wiki with $wgDisableCounters
set to true, sql error results due to a spelling mistake (d'oh!).

Sufficed to say, that's rather embarassing :s

Also change how code handles an unknown value, in
the internal ordermethod variable, since that
should never happen.

bug: 46523
Change-Id: Ibc38d3a092e4cff3147f77f7cdb51ebc0ad54a0e
---
M DynamicPageList.php
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/DynamicPageList.php b/DynamicPageList.php
index 0db847c..1275ba8 100644
--- a/DynamicPageList.php
+++ b/DynamicPageList.php
@@ -302,7 +302,7 @@
                                                if ( !$wgDisableCounters ) {
                                                        $orderMethod = 
'popularity';
                                                } else {
-                                                       $orderMethod = 
'categoyadd'; // default if hitcounter disabled.
+                                                       $orderMethod = 
'categoryadd'; // default if hitcounter disabled.
                                                }
                                                break;
                                        case 'categoryadd':
@@ -548,9 +548,11 @@
                        $sqlSort = 'page_counter';
                        break;
                case 'categoryadd':
-               default:
                        $sqlSort = 'c1.cl_timestamp';
                        break;
+               default:
+                       # Should never reach here
+                       throw new MWException( "Invalid ordermethod 
$orderMethod" );
        }
 
        $options['ORDER BY'] = "$sqlSort $sqlOrder";

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc38d3a092e4cff3147f77f7cdb51ebc0ad54a0e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/intersection
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to