Index: trunk/phase3/includes/SpecialMovepage.php |
— | — | @@ -304,28 +304,29 @@ |
305 | 305 | $this->moveTalk = false; |
306 | 306 | } |
307 | 307 | |
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 | | - |
317 | 308 | # Next make a list of id's. This might be marginally less efficient |
318 | 309 | # than a more direct method, but this is not a highly performance-cri- |
319 | 310 | # tical code path and readable code is more important here. |
320 | 311 | # |
321 | 312 | # Note: this query works nicely on MySQL 5, but the optimizer in MySQL |
322 | 313 | # 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. |
323 | 319 | $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 | + ) ) { |
325 | 326 | $conds = array( |
326 | 327 | 'page_title LIKE '.$dbr->addQuotes( $dbr->escapeLike( $ot->getDBkey() ) . '/%' ) |
327 | 328 | .' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() ) |
328 | 329 | ); |
329 | | - if( $this->moveTalk ) { |
| 330 | + if( $this->moveTalk && !empty( $wgNamespacesWithSubpages[$nt->getTalkPage()->getNamespace()] ) ) { |
330 | 331 | $conds['page_namespace'] = array( $ot->getNamespace(), |
331 | 332 | MWNamespace::getTalk($ot->getNamespace()) ); |
332 | 333 | } else { |