Copy wl_notificationtimestamp when copying watchlist entries on move
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 10 Nov 2014 17:01:28 +0000 (12:01 -0500)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 10 Nov 2014 18:21:17 +0000 (18:21 +0000)
When a page is moved, the new title is automatically added to the
watchlists of every user watching the old title. But we also need to
copy the wl_notificationtimestamp over, otherwise edits from before the
move aren't highlighted in the page history and such.

Bug: 73219
Change-Id: I657475c28944539daec14f838d3af4c2962a4b93

includes/WatchedItem.php

index ab136b8..fbd6119 100644 (file)
@@ -401,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'
                );
@@ -411,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,
                        );
                }