From 7f52cbc5b7d2a917a70b07f08a467ac3fc7b767d Mon Sep 17 00:00:00 2001 From: Fomafix Date: Tue, 16 Jan 2024 16:15:45 +0000 Subject: [PATCH] Stay on mode=categories after the first submit with all namespaces After the first submit the URL contains &namespaces= with empty value. This must be handled like a missing URL parameter. Restore the default value '' removed in aec8d755. Bug: T334289 Change-Id: I22d0eb334365472d411252f805d0d78a3cc265ab --- includes/CategoryTreePage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/CategoryTreePage.php b/includes/CategoryTreePage.php index ce4e903d..e9b983e6 100644 --- a/includes/CategoryTreePage.php +++ b/includes/CategoryTreePage.php @@ -122,9 +122,9 @@ class CategoryTreePage extends SpecialPage { * Input form for entering a category */ private function executeInputForm() { - $namespaces = $this->getRequest()->getRawVal( 'namespaces' ); + $namespaces = $this->getRequest()->getRawVal( 'namespaces' ) ?? ''; // mode may be overriden by namespaces option - $mode = ( $namespaces === null ? $this->getOption( 'mode' ) : CategoryTreeMode::ALL ); + $mode = ( $namespaces === '' ? $this->getOption( 'mode' ) : CategoryTreeMode::ALL ); if ( $mode === CategoryTreeMode::CATEGORIES ) { $modeDefault = 'categories'; } elseif ( $mode === CategoryTreeMode::PAGES ) {