diff --git a/lib/Database.php b/lib/Database.php index 006728fb..eaa6b3b0 100644 --- a/lib/Database.php +++ b/lib/Database.php @@ -2120,7 +2120,7 @@ class Database { select arsse_articles.id as article FROM arsse_articles join arsse_subscriptions on arsse_subscriptions.id = arsse_articles.subscription - WHERE arsse_articles.id = ? and arsse_subscriptions.owner = ? + WHERE arsse_articles.id = ? and arsse_subscriptions.owner = ? and arsse_subscriptions.deleted = 0 ) as articles left join arsse_editions on arsse_editions.article = articles.article group by articles.article", ["int", "str"] )->run($id, $user)->getRow(); diff --git a/tests/cases/Database/SeriesArticle.php b/tests/cases/Database/SeriesArticle.php index 6eff094d..1c1a8caa 100644 --- a/tests/cases/Database/SeriesArticle.php +++ b/tests/cases/Database/SeriesArticle.php @@ -207,6 +207,8 @@ trait SeriesArticle { [ 801,801], [ 802,802], [ 902,802], + [ 999,999], + [9999,999], ], ], 'arsse_enclosures' => [ @@ -531,6 +533,7 @@ trait SeriesArticle { 801 => 801, 802 => 802, 902 => 802, + 999 => 999, 1001 => 20, ]; $act = Arsse::$db->editionArticle(...range(1, 1001)); @@ -742,7 +745,12 @@ trait SeriesArticle { public function testMarkAMissingSubscription(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); - Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(2112)); + Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->subscription(1)); + } + + public function testMarkADeletedSubscription(): void { + $this->assertException("idMissing", "Db", "ExceptionInput"); + Arsse::$db->articleMark("john.doe@example.com", ['read' => true], (new Context)->subscription(16)); } public function testMarkAnArticle(): void { @@ -783,6 +791,11 @@ trait SeriesArticle { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->article(1)); } + public function testMarkAnArticleOfADeletedSubscription(): void { + $this->assertException("subjectMissing", "Db", "ExceptionInput"); + Arsse::$db->articleMark("john.doe@example.com", ['starred' => true], (new Context)->article(999)); + } + public function testMarkAnEdition(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(1101)); $now = Date::transform(time(), "sql"); @@ -874,6 +887,11 @@ trait SeriesArticle { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(2)); } + public function testMarkAnEditionOfADeletedSubscription(): void { + $this->assertException("subjectMissing", "Db", "ExceptionInput"); + Arsse::$db->articleMark("john.doe@example.com", ['starred' => true], (new Context)->edition(9999)); + } + public function testMarkByOldestEdition(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editionRange(2205, null)); $now = Date::transform(time(), "sql");