www.fgks.org   »   [go: up one dir, main page]

Page MenuHomePhabricator

Flow is accidentally overriding the class name of core actions
Closed, ResolvedPublic

Description

I noticed in my debug log

[ActionFactory] history is being set in configuration rather than CORE_ACTIONS

The issue appears to date to 2014 gerrit 131043 which had

// Register URL actions
foreach( $wgFlowActions as $action => $options ) {
	if ( is_array( $options ) && isset( $options['handler-class'] ) ) {
		$wgActions[$action] = true;
	}
}

Similar code persists now in Hooks.php. The intention was apparently to avoid an "action does not exist" error for Flow's own actions, but it also inadvertently sets $wgActions['history'] and $wgActions['view'] to true. It's harmless for now since the default is true, but it's tech debt which will break any attempt to inject services into core's ViewAction and HistoryAction.

I think core can be changed to not require $wgActions to be set when a ContentHandler override for an action exists.
Then this hack will not be necessary.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 768842 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Allow ContentHandler to "override" non-existent actions

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

I came across this issue when trying to inject services into view action is part of the initial patch for ActionFactory - I eventually switched to using a different action for demonstration of the new feature, but I guess I never reported this issue with Flow

Change 768847 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Flow@master] Stop setting $wgActions

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

Change 768842 merged by jenkins-bot:

[mediawiki/core@master] Allow ContentHandler to "override" non-existent actions

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

Change 768847 merged by jenkins-bot:

[mediawiki/extensions/Flow@master] Stop setting $wgActions

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

tstarling claimed this task.