r97576 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97575‎ | r97576 | r97577 >
Date:23:25, 19 September 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
MFT r97573 - hook to help with bug 31012 on MobileFrontend & similar
Modified paths:
  • /branches/wmf/1.17wmf1/docs/hooks.txt (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Wiki.php (modified) (history)
  • /branches/wmf/1.17wmf1/maintenance/update.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/maintenance/update.php
@@ -19,8 +19,8 @@
2020 /**
2121 * update.php is verboten on WMF cluster. It's *not* how you do schema updates
2222 */
23 -die( "Do not run update.php on the cluster. If you're seeing this you should
24 -probably ask for some help in performing your schema changes.\n" );
 23+#die( "Do not run update.php on the cluster. If you're seeing this you should
 24+#probably ask for some help in performing your schema changes.\n" );
2525
2626 $wgUseMasterForMaintenance = true;
2727 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
Index: branches/wmf/1.17wmf1/docs/hooks.txt
@@ -1647,6 +1647,11 @@
16481648 &$join_conds: join conditions for the tables
16491649 &$fields: array of query fields
16501650
 1651+'TestCanonicalRedirect': called when about to force a redirect to a canonical URL for a title when we have no other parameters on the URL. Gives a chance for extensions that alter page view behavior radically to abort that redirect or handle it manually.
 1652+$request: WebRequest
 1653+$title: Title of the currently found title obj
 1654+$output: OutputPage object
 1655+
16511656 'TitleArrayFromResult': called when creating an TitleArray object from a
16521657 database result
16531658 &$titleArray: set this to an object to override the default object returned
Index: branches/wmf/1.17wmf1/includes/Wiki.php
@@ -208,7 +208,8 @@
209209 // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
210210 } else if ( $action == 'view' && !$request->wasPosted()
211211 && ( $request->getVal( 'title' ) === null || $title->getPrefixedDBKey() != $request->getVal( 'title' ) )
212 - && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) )
 212+ && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) )
 213+ && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) ) )
213214 {
214215 if ( $title->getNamespace() == NS_SPECIAL ) {
215216 list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r97580MFT r97573 - hook to help with bug 31012 on MobileFrontend & similarbrion23:51, 19 September 2011
r97645fix for bug 31012 - mobile version replaced by desktop version in a webview o...preilly17:21, 20 September 2011
r97735Partial revert r97576, update.php should be disabled in wmf branchdemon14:29, 21 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97573Add in a 'TestCanonicalRedirect' hook to be called when about to make a redir...brion23:14, 19 September 2011
r97574MFT r97573 - hook to help with bug 31012 on MobileFrontend & similarbrion23:23, 19 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   06:58, 20 September 2011

With unrelated changes?

#Comment by Catrope (talk | contribs)   12:11, 21 September 2011
-die( "Do not run update.php on the cluster. If you're seeing this you should
-probably ask for some help in performing your schema changes.\n" );
+#die( "Do not run update.php on the cluster. If you're seeing this you should
+#probably ask for some help in performing your schema changes.\n" );

WTF?

#Comment by Brion VIBBER (talk | contribs)   18:52, 21 September 2011

Accidental commit -- I'd had to do a local hack in order to run update.php.

We should perhaps consider allowing a command-line override instead of forcing it to die, so people don't have to do this while testing and maintaining the deployment branches. :)

Status & tagging log