diff --git a/CHANGELOG.md b/CHANGELOG.md index 62b3357bd5..46bcd361d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is almost based on [Keep a Changelog](https://keepachangelog.com/en/1 ### Changed ### Fixed +- Fix update queries (#1211) ## [15.4.0-beta2] - 2021-02-27 ### Fixed diff --git a/lib/Db/FeedMapperV2.php b/lib/Db/FeedMapperV2.php index 5e346732c3..618adb44d2 100644 --- a/lib/Db/FeedMapperV2.php +++ b/lib/Db/FeedMapperV2.php @@ -164,7 +164,7 @@ public function read(string $userId, int $id, ?int $maxItemID = null): void $builder = $this->db->getQueryBuilder(); $builder->update(ItemMapperV2::TABLE_NAME, 'items') ->innerJoin('items', FeedMapperV2::TABLE_NAME, 'feeds', 'items.feed_id = feeds.id') - ->setValue('unread', 0) + ->set('unread', 0) ->andWhere('feeds.user_id = :userId') ->andWhere('feeds.id = :feedId') ->setParameter('userId', $userId) diff --git a/lib/Db/FolderMapperV2.php b/lib/Db/FolderMapperV2.php index 12fa268875..9f507df620 100644 --- a/lib/Db/FolderMapperV2.php +++ b/lib/Db/FolderMapperV2.php @@ -108,7 +108,7 @@ public function read(string $userId, int $id, ?int $maxItemID = null): void $builder = $this->db->getQueryBuilder(); $builder->update(ItemMapperV2::TABLE_NAME, 'items') ->innerJoin('items', FeedMapperV2::TABLE_NAME, 'feeds', 'items.feed_id = feeds.id') - ->setValue('unread', 0) + ->set('unread', 0) ->andWhere('feeds.user_id = :userId') ->andWhere('feeds.folder_id = :folderId') ->setParameter('userId', $userId) diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php index 33b4611f91..6c57ac6883 100644 --- a/lib/Db/ItemMapperV2.php +++ b/lib/Db/ItemMapperV2.php @@ -261,7 +261,7 @@ public function readAll(string $userId, int $maxItemId): void $builder->update($this->tableName, 'items') ->innerJoin('items', FeedMapperV2::TABLE_NAME, 'feeds', 'items.feed_id = feeds.id') - ->setValue('unread', 0) + ->set('unread', 0) ->andWhere('items.id =< :maxItemId') ->andWhere('feeds.user_id = :userId') ->setParameter('maxItemId', $maxItemId) diff --git a/tests/Unit/Db/FeedMapperTest.php b/tests/Unit/Db/FeedMapperTest.php index 780bfbc386..93b70dc428 100644 --- a/tests/Unit/Db/FeedMapperTest.php +++ b/tests/Unit/Db/FeedMapperTest.php @@ -472,7 +472,7 @@ public function testRead() ->will($this->returnSelf()); $this->builder->expects($this->once()) - ->method('setValue') + ->method('set') ->with('unread', 0) ->will($this->returnSelf()); @@ -517,7 +517,7 @@ public function testReadWithMaxId() ->will($this->returnSelf()); $this->builder->expects($this->once()) - ->method('setValue') + ->method('set') ->with('unread', 0) ->will($this->returnSelf()); @@ -541,4 +541,4 @@ public function testReadWithMaxId() $this->class->read('admin', 1, 4); } -} \ No newline at end of file +} diff --git a/tests/Unit/Db/FolderMapperTest.php b/tests/Unit/Db/FolderMapperTest.php index 026c16bc68..3a992fce39 100644 --- a/tests/Unit/Db/FolderMapperTest.php +++ b/tests/Unit/Db/FolderMapperTest.php @@ -300,7 +300,7 @@ public function testRead() ->will($this->returnSelf()); $this->builder->expects($this->once()) - ->method('setValue') + ->method('set') ->with('unread', 0) ->will($this->returnSelf()); @@ -345,7 +345,7 @@ public function testReadWithMaxId() ->will($this->returnSelf()); $this->builder->expects($this->once()) - ->method('setValue') + ->method('set') ->with('unread', 0) ->will($this->returnSelf()); @@ -369,4 +369,4 @@ public function testReadWithMaxId() $this->class->read('admin', 1, 4); } -} \ No newline at end of file +} diff --git a/tests/Unit/Db/ItemMapperTest.php b/tests/Unit/Db/ItemMapperTest.php index 490f13e712..4eb6f2f694 100644 --- a/tests/Unit/Db/ItemMapperTest.php +++ b/tests/Unit/Db/ItemMapperTest.php @@ -487,7 +487,7 @@ public function testReadAll() ->will($this->returnSelf()); $this->builder->expects($this->once()) - ->method('setValue') + ->method('set') ->with('unread', 0) ->will($this->returnSelf()); @@ -1055,4 +1055,4 @@ public function testDeleteOverThresholdSuccessUnreadSkipsIfUnderThreshold() $this->assertSame(10, $res); } -} \ No newline at end of file +}