r108343 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108342‎ | r108343 | r108344 >
Date:01:34, 8 January 2012
Author:krinkle
Status:reverted (Comments)
Tags:bug27930 
Comment:
[mw.config] wgAction shouldn't use direct URL values
* Fixes bug 25800
* Depends on r108342
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2822,7 +2822,7 @@
28232823 * @return array
28242824 */
28252825 public function getJSVars() {
2826 - global $wgUseAjax, $wgEnableMWSuggest;
 2826+ global $wgUseAjax, $wgEnableMWSuggest, $mediaWiki;
28272827
28282828 $title = $this->getTitle();
28292829 $ns = $title->getNamespace();
@@ -2858,7 +2858,7 @@
28592859 'wgCurRevisionId' => $title->getLatestRevID(),
28602860 'wgArticleId' => $title->getArticleId(),
28612861 'wgIsArticle' => $this->isArticle(),
2862 - 'wgAction' => $this->getRequest()->getText( 'action', 'view' ),
 2862+ 'wgAction' => $mediaWiki->getPerformedAction(),
28632863 'wgUserName' => $this->getUser()->isAnon() ? null : $this->getUser()->getName(),
28642864 'wgUserGroups' => $this->getUser()->getEffectiveGroups(),
28652865 'wgCategories' => $this->getCategories(),

Follow-up revisions

RevisionCommit summaryAuthorDate
r108344release notes for r108343krinkle01:41, 8 January 2012
r108345[Skin] Add CSS hook for action ("action-.." class on body)...krinkle01:49, 8 January 2012
r109223[Actions] Move action logic out of MediaWiki::getAction/MediaWiki::performAct...krinkle21:49, 17 January 2012
r109678Reinstate r109223 per CR + fixes...krinkle06:57, 21 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91870wgAction incorrectly asumes 'view' instead of 'historysubmit' on diff-pages w...diebuche10:54, 11 July 2011
r108342Implement MediaWiki::getPerformedAction()...krinkle01:31, 8 January 2012

Comments

#Comment by Hashar (talk | contribs)   14:20, 10 January 2012

Shouldn't getPerformedAction() be part of RequestContext?

#Comment by Hashar (talk | contribs)   14:21, 10 January 2012

Same issue on r108345

#Comment by Dantman (talk | contribs)   14:33, 10 January 2012

I don't believe so. Actions are high-level things specific to this one way we render a page based on the url. The request could say come from a separate entrypoint, one in which actions have absolutely meaning at all. Hence it isn't really abstract enough for a RequestContext.

However I believe that this should make sure that $mediaWiki is actually set, I don't believe that it's existence should be required for a page to be rendered. We can build pages in other ways.

#Comment by Hashar (talk | contribs)   22:17, 10 January 2012

> However I believe that this should make sure that $mediaWiki is actually set, I don't believe that it's existence should be required for a page to be rendered. We can build pages in other ways.

Yeah that was my concern. This change, and the other, add a dependency to OutputPage :-(

Maybe the action could be passed as a function argument or on construction.

#Comment by Nikerabbit (talk | contribs)   08:38, 13 January 2012

Yes it should indeed:

PHP Fatal error:  Call to a member function getPerformedAction() on a non-object in /www/w/includes/OutputPage.php on line 2863
#Comment by Hashar (talk | contribs)   11:23, 13 January 2012

Where / how to reproduce etc?  :-)

#Comment by Nikerabbit (talk | contribs)   11:24, 13 January 2012

Some API calls.

#Comment by Nikerabbit (talk | contribs)   11:26, 13 January 2012

http://translatewiki.net/ w/api.php?feedformat=atom&type=%27%29%20declare%20%40q%20varchar%288000%29%20select%20%40q%20%3D%200x57414954464F522044454C4159202730303A30303A313527%20exec%28%40q%29%20--&talkpage=Support&action=feedthreads

#Comment by Krinkle (talk | contribs)   14:42, 13 January 2012

See r108342 CR for discussion/solution.

#Comment by Hashar (talk | contribs)   14:18, 19 January 2012

Back to new. This is still in trunk@109530

Status & tagging log