Index: trunk/phase3/includes/WatchlistEditor.php |
— | — | @@ -269,18 +269,10 @@ |
270 | 270 | private function watchTitles( $titles, $user ) { |
271 | 271 | $dbw = wfGetDB( DB_MASTER ); |
272 | 272 | $rows = array(); |
273 | | - $articles = array(); |
274 | 273 | foreach( $titles as $title ) { |
275 | 274 | if( !$title instanceof Title ) |
276 | 275 | $title = Title::newFromText( $title ); |
277 | 276 | if( $title instanceof Title ) { |
278 | | - $article = new Article( $title ); |
279 | | - if ( !wfRunHooks('WatchArticle',array( &$user, &$article ) ) ){ |
280 | | - continue; |
281 | | - } |
282 | | - // queue the ids rather than the objects, since the hook could potentially |
283 | | - // load the entire object and make memory trouble |
284 | | - $articleIds[] = $article->getID(); |
285 | 277 | $rows[] = array( |
286 | 278 | 'wl_user' => $user->getId(), |
287 | 279 | 'wl_namespace' => ( $title->getNamespace() & ~1 ), |
— | — | @@ -296,10 +288,6 @@ |
297 | 289 | } |
298 | 290 | } |
299 | 291 | $dbw->insert( 'watchlist', $rows, __METHOD__, 'IGNORE' ); |
300 | | - foreach( $articleIds as $articleId ){ |
301 | | - $article = Article::newFromID($articleId); |
302 | | - wfRunHooks('WatchArticleComplete',array(&$user,&$article)); |
303 | | - } |
304 | 292 | } |
305 | 293 | |
306 | 294 | /** |
— | — | @@ -317,10 +305,6 @@ |
318 | 306 | if( !$title instanceof Title ) |
319 | 307 | $title = Title::newFromText( $title ); |
320 | 308 | if( $title instanceof Title ) { |
321 | | - $article = new Article($title); |
322 | | - if(!wfRunHooks('UnwatchArticle',array(&$user,&$article))){ |
323 | | - continue; |
324 | | - } |
325 | 309 | $dbw->delete( |
326 | 310 | 'watchlist', |
327 | 311 | array( |
— | — | @@ -339,6 +323,7 @@ |
340 | 324 | ), |
341 | 325 | __METHOD__ |
342 | 326 | ); |
| 327 | + $article = new Article($title); |
343 | 328 | wfRunHooks('UnwatchArticleComplete',array(&$user,&$article)); |
344 | 329 | } |
345 | 330 | } |