Page MenuHomePhabricator

$wgMainPageIsDomainRoot breaks $wgActionPaths for Main Page
Closed, ResolvedPublic

Description

Let's say you have a custom action path such as:

$wgActionPaths['edit'] = "$wgScriptPath/edit/$1";

Setting $wgMainPageIsDomainRoot = true; will make the edit tab for the main page go nowhere (href="/") rather than the custom action path. This happens for all Main Page actions with a custom action path. The action URLs are getting caught in this if statement in Title.php's getLocalURL():

if ( $wgMainPageIsDomainRoot && $this->isMainPage() && $query === '' ) {
	return '/';
}

So basically the $query === '' is what prevents this problem in the typical case, but is not sufficient for catching the custom action URLs. At first glance, adding && !isset( $action ) to the if statement check seems to fix it.

Event Timeline

Change 655778 had a related patch set uploaded (by Porplemontage; owner: Porplemontage):
[mediawiki/core@master] Fix main page tab URLs when using $wgMainPageIsDomainRoot and custom $wgActionPaths

https://gerrit.wikimedia.org/r/655778

Adding Platform Engineering as there is a one-line core patch awaiting review for four weeks. Who is supposed to review?

Change 655778 merged by jenkins-bot:

[mediawiki/core@master] Fix main page tab URLs when using $wgMainPageIsDomainRoot and custom $wgActionPaths

https://gerrit.wikimedia.org/r/655778