return $output;
}
+
+ /**
+ * Check if this filter group is currently active
+ *
+ * @param {boolean} $isStructuredUI Is structured filters UI current enabled
+ */
+ public function isActive( $isStructuredUI ) {
+ // STRING_OPTIONS filter groups are exclusively active on Structured UI
+ return $isStructuredUI;
+ }
}
// URL parameters can be per-group, like 'userExpLevel',
// or per-filter, like 'hideminor'.
if ( $filterGroup->isPerGroupRequestParameter() ) {
- $filterGroup->modifyQuery( $dbr, $this, $tables, $fields, $conds,
- $query_options, $join_conds, $opts[$filterGroup->getName()] );
+ if ( $filterGroup->isActive( $isStructuredUI ) ) {
+ $filterGroup->modifyQuery( $dbr, $this, $tables, $fields, $conds,
+ $query_options, $join_conds, $opts[$filterGroup->getName()] );
+ }
} else {
foreach ( $filterGroup->getFilters() as $filter ) {
if ( $filter->isActive( $opts, $isStructuredUI ) ) {
* @covers ChangesListSpecialPage
*/
class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase {
+ public function setUp() {
+ parent::setUp();
+ $this->setMwGlobals( [
+ 'wgStructuredChangeFiltersShowPreference' => true,
+ ] );
+ }
+
protected function getPage() {
$mock = $this->getMockBuilder( ChangesListSpecialPage::class )
->setConstructorArgs(