Fix initialization of Context in Action class.
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 19 Sep 2013 10:56:42 +0000 (12:56 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Thu, 19 Sep 2013 13:11:00 +0000 (15:11 +0200)
commit01d81d882bf8082fbb457b148a2383ecb7614c72
tree885671b64a1ed3206314e1f33ef398e876e8f67d
parent324328a3850a132280ecbd9351b5abcc39db52df
Fix initialization of Context in Action class.

When Action::getActionName calls Action::factory, $context
must be passed explicitly, since WikiPage does not have a getContext()
method (only Article does).

As a failsafe in Article::getContext(), use $this->page->getContext()
only if $this->page is an Article. If $this->context is null and $this->page
is not an article, fall back to RequestContext::getMain()

Change-Id: I6d8db29dfd1aaa68f3de4f8f418841205c2379af
includes/Action.php