Dvogel hallowelt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/270286
Change subject: getCustomList: modified namespace argument
......................................................................
getCustomList: modified namespace argument
*ns="all" is now including ns="6" (images)
*excludens is working now
Previously smartlist did not show ns="6", even if it was set
explizit.
Change-Id: Ib28aaeb60c40cb02ffa70cb45980937751dd258a
---
M SmartList/SmartList.class.php
1 file changed, 11 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/86/270286/1
diff --git a/SmartList/SmartList.class.php b/SmartList/SmartList.class.php
index 2f56c3d..2dbd7ab 100644
--- a/SmartList/SmartList.class.php
+++ b/SmartList/SmartList.class.php
@@ -721,8 +721,18 @@
break;
}
+ $aNamespaceIds = array();
try {
$aNamespaceIds =
BsNamespaceHelper::getNamespaceIdsFromAmbiguousCSVString( $aArgs['namespaces']
);
+
+ if ( isset( $aArgs['excludens'] ) ) {
+ $aExcludedId = array();
+ $aNamespaceDiffId = array();
+ $aExcludedId =
BsNamespaceHelper::getNamespaceIdsFromAmbiguousCSVString( $aArgs['excludens'] );
+ $aNamespaceDiffId= array_diff(
$aNamespaceIds, $aExcludedId );
+ $aNamespaceIds = $aNamespaceDiffId;
+ }
+
$aConditions[] = 'rc_namespace IN (' . implode(
',', $aNamespaceIds ) . ')';
} catch ( BsInvalidNamespaceException $ex ) {
$sInvalidNamespaces = implode( ', ',
$ex->getListOfInvalidNamespaces() );
@@ -769,7 +779,7 @@
}
$aConditions[] = 'rc_title = page_title AND
rc_namespace = page_namespace'; //prevent display of deleted articles
- $aConditions[] = 'NOT (rc_type = 3)'; //prevent moves
and deletes from being displayed
+ $aConditions[] = 'NOT ( rc_type = 3 AND NOT (
rc_namespace = 6 ) )'; //include files
$aFields = array( 'rc_title as title', 'rc_namespace as
namespace' );
if ( isset( $aArgs['meta'] ) && $aArgs['meta'] == true
) {
--
To view, visit https://gerrit.wikimedia.org/r/270286
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib28aaeb60c40cb02ffa70cb45980937751dd258a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_23
Gerrit-Owner: Dvogel hallowelt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits