r35256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35255‎ | r35256 | r35257 >
Date:21:22, 23 May 2008
Author:simetrical
Status:old
Tags:
Comment:
Fix bug: we still need to move subpages if we're moving the talk page, and the talk namespace allows subpages.
Modified paths:
  • /trunk/phase3/includes/SpecialMovepage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialMovepage.php
@@ -304,28 +304,29 @@
305305 $this->moveTalk = false;
306306 }
307307
308 - # If the target namespace doesn't allow subpages, moving with subpages
309 - # would mean that you couldn't move them back in one operation, which
310 - # is bad.
311 - #
312 - # FIXME: A specific error message should be given in this case.
313 - if( empty( $wgNamespacesWithSubpages[$nt->getNamespace()] ) ) {
314 - $this->moveSubpages = false;
315 - }
316 -
317308 # Next make a list of id's. This might be marginally less efficient
318309 # than a more direct method, but this is not a highly performance-cri-
319310 # tical code path and readable code is more important here.
320311 #
321312 # Note: this query works nicely on MySQL 5, but the optimizer in MySQL
322313 # 4 might get confused. If so, consider rewriting as a UNION.
 314+ #
 315+ # If the target namespace doesn't allow subpages, moving with subpages
 316+ # would mean that you couldn't move them back in one operation, which
 317+ # is bad. FIXME: A specific error message should be given in this
 318+ # case.
323319 $dbr = wfGetDB( DB_SLAVE );
324 - if( $this->moveSubpages ) {
 320+ if( $this->moveSubpages && (
 321+ !empty($wgNamespacesWithSubpages[$nt->getNamespace()]) || (
 322+ $this->moveTalk &&
 323+ !empty( $wgNamespacesWithSubpages[$nt->getTalkPage()->getNamespace()] )
 324+ )
 325+ ) ) {
325326 $conds = array(
326327 'page_title LIKE '.$dbr->addQuotes( $dbr->escapeLike( $ot->getDBkey() ) . '/%' )
327328 .' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
328329 );
329 - if( $this->moveTalk ) {
 330+ if( $this->moveTalk && !empty( $wgNamespacesWithSubpages[$nt->getTalkPage()->getNamespace()] ) ) {
330331 $conds['page_namespace'] = array( $ot->getNamespace(),
331332 MWNamespace::getTalk($ot->getNamespace()) );
332333 } else {

Status & tagging log