Smuggli has submitted this change and it was merged.
Change subject: Fixed namespace filter in SmartList (toplist)
......................................................................
Fixed namespace filter in SmartList (toplist)
* fixed query (in instead of =)
* fixed empty clause (string 0 is empty)
Change-Id: I80f663993760d5ac6dc9b645a18233a334473d4c
---
M SmartList/SmartList.class.php
1 file changed, 6 insertions(+), 10 deletions(-)
Approvals:
Smuggli: Verified; Looks good to me, approved
diff --git a/SmartList/SmartList.class.php b/SmartList/SmartList.class.php
index 1529c2b..1a447db 100644
--- a/SmartList/SmartList.class.php
+++ b/SmartList/SmartList.class.php
@@ -1044,18 +1044,14 @@
}
}
- if ( !empty( $sNs ) ) {
- $iNamespaces =
BsNamespaceHelper::getNamespaceIdsFromAmbiguousCSVString( $sNs );
- if ( is_array( $iNamespaces ) ) {
- foreach ( $iNamespaces as $iNamespace ) {
- if ( $bAlltime === false ) {
-
$aConditions['wo_page_namespace'] = $iNamespace;
- } else {
- $aConditions['page_namespace']
= $iNamespace;
- }
- }
+ if ( !empty( $sNs ) || $sNs === '0') { // string 0 is empty
+ $aNamespaces =
BsNamespaceHelper::getNamespaceIdsFromAmbiguousCSVString( $sNs );
+ if ( !empty( $aNamespaces ) ) {
+ $sField = $bAlltime ? 'page_namespace' :
'wo_page_namespace';
+ $aConditions[$sField] = $aNamespaces;
}
}
+
$res = $oDbr->select(
$aTables,
$aColumns,
--
To view, visit https://gerrit.wikimedia.org/r/168058
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I80f663993760d5ac6dc9b645a18233a334473d4c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Pwirth <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pigpen <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: Smuggli <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits