From a2aa2bf990afe11fa73dae788cdc0b2e50f7b929 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 6 Apr 2016 23:49:31 +0200 Subject: try to fix mysql --- db/mysql/itemmapper.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'db/mysql/itemmapper.php') diff --git a/db/mysql/itemmapper.php b/db/mysql/itemmapper.php index 720f03744..fa08f933f 100644 --- a/db/mysql/itemmapper.php +++ b/db/mysql/itemmapper.php @@ -64,6 +64,8 @@ class ItemMapper extends \OCA\News\Db\ItemMapper { } public function readItem($itemId, $isRead, $lastModified, $userId) { + $item = $this->find($itemId, $userId); + if ($isRead) { $sql = 'UPDATE `*PREFIX*news_items` `items` JOIN `*PREFIX*news_feeds` `feeds` @@ -76,8 +78,9 @@ class ItemMapper extends \OCA\News\Db\ItemMapper { $item->getFingerprint(), $userId]; $this->execute($sql, $params); } else { - // no other behavior for mysql if should be marked unread - parent::readItem($itemId, $isRead, $lastModified, $userId); + $item->setLastModified($lastModified); + $item->setUnread(); + $this->update($item); } } -- cgit v1.2.3