Index: trunk/extensions/DynamicPageList/DPL.php |
— | — | @@ -1124,7 +1124,7 @@ |
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | function updateArticle( $title, $text, $summary ) { |
1128 | | - global $wgUser, $wgRequest, $wgArticle, $wgOut; |
| 1128 | + global $wgUser, $wgRequest, $wgOut; |
1129 | 1129 | |
1130 | 1130 | if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) { |
1131 | 1131 | $wgOut->addWikiMsg( 'sessionfailure' ); |
— | — | @@ -1132,11 +1132,11 @@ |
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | $titleX = Title::newFromText( $title ); |
1136 | | - |
1137 | | - $wgArticle = $articleX = new Article( $titleX ); |
1138 | | - $permission_errors = $articleX->mTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
| 1136 | + $permission_errors = $titleX->getUserPermissionsErrors( 'edit', $wgUser ); |
1139 | 1137 | if ( count( $permission_errors ) == 0 ) { |
1140 | | - $articleX->updateArticle( $text, $summary, false, $titleX->userIsWatching() ); |
| 1138 | + $articleX = new Article( $titleX ); |
| 1139 | + $articleX->doEdit( $text, $summary, EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY ); |
| 1140 | + $wgOut->redirect( $titleX->getFullUrl( $articleX->isRedirect() ? 'redirect=no' : '' ) ); |
1141 | 1141 | return ''; |
1142 | 1142 | } else { |
1143 | 1143 | $wgOut->showPermissionsErrorPage( $permission_errors ); |
— | — | @@ -1425,11 +1425,9 @@ |
1426 | 1426 | $reason .= "\nbulk delete by DPL query"; |
1427 | 1427 | |
1428 | 1428 | $titleX = Title::newFromText( $title ); |
1429 | | - global $wgArticle; |
1430 | | - $wgArticle = $articleX = new Article( $titleX ); |
1431 | 1429 | if ( $exec ) { |
1432 | 1430 | # Check permissions |
1433 | | - $permission_errors = $articleX->mTitle->getUserPermissionsErrors( 'delete', $wgUser ); |
| 1431 | + $permission_errors = $titleX->getUserPermissionsErrors( 'delete', $wgUser ); |
1434 | 1432 | if ( count( $permission_errors ) > 0 ) { |
1435 | 1433 | $wgOut->showPermissionsErrorPage( $permission_errors ); |
1436 | 1434 | return 'permission error'; |
— | — | @@ -1437,6 +1435,7 @@ |
1438 | 1436 | $wgOut->readOnlyPage(); |
1439 | 1437 | return 'DPL: read only mode'; |
1440 | 1438 | } else { |
| 1439 | + $articleX = new Article( $titleX ); |
1441 | 1440 | $articleX->doDelete( $reason ); |
1442 | 1441 | } |
1443 | 1442 | } else { |
Index: trunk/extensions/DynamicPageList/DPLMain.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | error_reporting( E_ALL ); |
19 | 19 | |
20 | 20 | global $wgUser, $wgLang, $wgContLang, $wgRequest, $wgRawHtml; |
21 | | - global $wgTitle, $wgArticle, $wgNonincludableNamespaces; |
| 21 | + global $wgTitle, $wgNonincludableNamespaces; |
22 | 22 | |
23 | 23 | // we use "makeKnownLinkObject" to create hyperlinks; |
24 | 24 | // the code we store in the dplcache may contain <html>....</html> sequences |
— | — | @@ -1413,10 +1413,8 @@ |
1414 | 1414 | |
1415 | 1415 | case 'dplcache': |
1416 | 1416 | if ( $sArg != '' ) { |
1417 | | - if ( isset( $wgArticle ) ) { |
1418 | | - $DPLCache = $wgArticle->getID() . '_' . $sArg . '.txt'; |
1419 | | - $DPLCachePath = $wgArticle->getID() % 10; |
1420 | | - } |
| 1417 | + $DPLCache = $parser->mTitle->getArticleID() . '_' . $sArg . '.txt'; |
| 1418 | + $DPLCachePath = $parser->mTitle->getArticleID() % 10; |
1421 | 1419 | } else { |
1422 | 1420 | $output .= $logger->msgWrongParam( 'dplcache', $sArg ); |
1423 | 1421 | } |
— | — | @@ -3269,7 +3267,7 @@ |
3270 | 3268 | // update dependencies to CacheAPI if DPL is to respect the MW ParserCache and the page containing the DPL query is changed |
3271 | 3269 | if ( ExtDynamicPageList::$useCacheAPI && $bAllowCachedResults && $wgRequest->getVal( 'action', 'view' ) == 'submit' ) { |
3272 | 3270 | /* |
3273 | | - CacheAPI::remDependencies( $wgArticle->getID()); |
| 3271 | + CacheAPI::remDependencies( $parser->mTitle->getArticleID()); |
3274 | 3272 | |
3275 | 3273 | // add category dependencies |
3276 | 3274 | $conditionTypes = array( CACHETYPE_CATEGORY ); |
— | — | @@ -3290,7 +3288,7 @@ |
3291 | 3289 | |
3292 | 3290 | // add general dependencies |
3293 | 3291 | |
3294 | | - // CacheAPI::addDependencies ( $wgArticle->getID(), $conditionTypes, $conditions); |
| 3292 | + // CacheAPI::addDependencies ( $parser->mTitle->getArticleID(), $conditionTypes, $conditions); |
3295 | 3293 | */ |
3296 | 3294 | } |
3297 | 3295 | |