Page MenuHomePhabricator

Incorrect update to wl_notificationtimestamp in WatchedItem.php
Closed, ResolvedPublic

Description

Inside WatchedItem.php,. at the end of resetNotificationTimestamp, there is a call to update a user's watchlist like so:

$dbw->update( 'watchlist', array( 'wl_notificationtimestamp' =>$notificationTimestamp ), $this->dbCond(), METHOD );

As $notificationTimestamp can be a raw string at this point, the call needs to be:

$dbw->update( 'watchlist', array( 'wl_notificationtimestamp' => $dbw->timestamp( $notificationTimestamp ) ), $this->dbCond(), METHOD );

Event Timeline

Greg_Sabino_Mullane raised the priority of this task from to Needs Triage.
Greg_Sabino_Mullane updated the task description. (Show Details)

@Greg_Sabino_Mullane: Thanks for taking a look at the code!

You are very welcome to use developer access to submit this as a Git branch directly into Gerrit.

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

Change 254675 had a related patch set uploaded (by Umherirrender):
Call DB::timestampOrNull in WatchedItem::resetNotificationTimestamp

https://gerrit.wikimedia.org/r/254675

Change 254675 merged by jenkins-bot:
Call DB::timestampOrNull in WatchedItem::resetNotificationTimestamp

https://gerrit.wikimedia.org/r/254675