X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWatchedItem.php;h=fbd61199f21c381c47844f52631e5645e85ca45e;hb=fc505d4fa538c933cd1e2637454bbd2ccb8bcaae;hp=93d6c0b13690bab741cb6b978b5ca33f070f3432;hpb=5203b9bb237766305d6b80a649754ff51c8928ad;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 93d6c0b136..fbd61199f2 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -164,6 +164,7 @@ class WatchedItem { /** * Check permissions * @param string $what 'viewmywatchlist' or 'editmywatchlist' + * @return bool */ private function isAllowed( $what ) { return !$this->mCheckRights || $this->mUser->isAllowed( $what ); @@ -273,7 +274,7 @@ class WatchedItem { * @param WatchedItem[] $items * @return bool */ - static public function batchAddWatch( array $items ) { + public static function batchAddWatch( array $items ) { $section = new ProfileSection( __METHOD__ ); if ( wfReadOnly() ) { @@ -308,7 +309,7 @@ class WatchedItem { } $dbw = wfGetDB( DB_MASTER ); - foreach( array_chunk( $rows, 100 ) as $toInsert ) { + foreach ( array_chunk( $rows, 100 ) as $toInsert ) { // Use INSERT IGNORE to avoid overwriting the notification timestamp // if there's already an entry for this page $dbw->insert( 'watchlist', $toInsert, __METHOD__, 'IGNORE' ); @@ -400,7 +401,8 @@ class WatchedItem { $newtitle = $nt->getDBkey(); $dbw = wfGetDB( DB_MASTER ); - $res = $dbw->select( 'watchlist', 'wl_user', + $res = $dbw->select( 'watchlist', + array( 'wl_user', 'wl_notificationtimestamp' ), array( 'wl_namespace' => $oldnamespace, 'wl_title' => $oldtitle ), __METHOD__, 'FOR UPDATE' ); @@ -410,7 +412,8 @@ class WatchedItem { $values[] = array( 'wl_user' => $s->wl_user, 'wl_namespace' => $newnamespace, - 'wl_title' => $newtitle + 'wl_title' => $newtitle, + 'wl_notificationtimestamp' => $s->wl_notificationtimestamp, ); }