Robert Vogel has submitted this change and it was merged.

Change subject: ExtendedSearch: Fix for facetts
......................................................................


ExtendedSearch: Fix for facetts

* Changed the SearchOptions in case that no namespace facettes are
  provided in the request. Formerly the facett was kept empty. But
  pseudo-namespaces for files where added which resulted in a bad query

* Removed mechanism to empty namespaces facett in SearchOptions if the
  source of the request was not 'titlebar'. This resulted in a wrong
  display of facett checkboxes

Change-Id: Ifc4618f361c37f82b4bad38e698e0b8b5453d72b
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
1 file changed, 2 insertions(+), 6 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 71fad25..0416183 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -382,8 +382,8 @@
                                }
 
                                $aDiff = array_diff( array_keys( $aNamespaces 
), $this->aOptions['namespaces'] );
-                               if ( empty( $aDiff ) ) {
-                                       $this->aOptions['namespaces'] = array();
+                               if ( !empty( $aDiff ) ) {
+                                       $this->aOptions['namespaces'] = 
array_values($aDiff);
                                }
                        } else {
                                wfRunHooks( 
'BSExtendedSearchEmptyNamespacesElse', array( $this, $oSearchRequest ) );
@@ -450,10 +450,6 @@
                        $aFq[] = ( BsConfig::get( 
'MW::ExtendedSearch::ShowFacets' ) )
                                ? '{!tag=na}namespace:(' . implode( ' ', 
$aFqNamespaces ) . ')'
                                : 'namespace:(' . implode( ' ', $aFqNamespaces 
) . ')';
-               }
-
-               if ( empty( $oSearchRequest->aNamespaces ) && 
$this->aOptions['searchOrigin'] != 'titlebar' ) {
-                       $this->aOptions['namespaces'] = array();
                }
 
                if ( $vNamespace !== false ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifc4618f361c37f82b4bad38e698e0b8b5453d72b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_22
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pigpen <[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