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
This commit is contained in:
Fomafix 2024-01-16 16:15:45 +00:00 committed by Jforrester
parent cf210d9548
commit 7f52cbc5b7

View file

@ -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 ) {