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 --- CHANGELOG.md | 6 +++++- db/mysql/itemmapper.php | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b54858566..34c93d0b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ +owncloud-news (8.2.0) +* **Backwards incompatible change**: Move updater into separate repository at https://github.com/owncloud/news-updater and publish it at pypi +* **Enhancement**: Marking an item as read will now mark all similar items of the same user as read, regardless of the feed, #465 + owncloud-news (8.1.0) * **Backwards incompatible change**: URLs for the Python updater must now start with either http:// or https:// -* **Bugfix**: Fix bug that would not package all JavaScript files for the app store zip, #959 * **Enhancement**: Change Python updater License from AGPL3+ to GPL3+ +* **Bugfix**: Fix bug that would not package all JavaScript files for the app store zip, #959 * **Enhancement**: Add console API to update feeds in parallel * **Enhancement**: Add an additional parameter to specify the loglevel for the Python updater * **Enhancement**: Adjust Python updater to be able to use the console API. If you pass an absolute directory as url (path to your ownCloud), the updater will try to use **occ** updater commands using php. This requires no user or password arguments which makes running the updater on the same system as your ownCloud more secure 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