diff --git a/lib/Database.php b/lib/Database.php index 043b993d..f5409d10 100644 --- a/lib/Database.php +++ b/lib/Database.php @@ -2002,14 +2002,11 @@ class Database { } return $this->db->prepare( "SELECT - arsse_tags.id as tag_id, - arsse_tags.name as tag_name, - arsse_subscriptions.id as subscription_id, - coalesce(arsse_subscriptions.title, arsse_feeds.title) as subscription_name + arsse_tags.id as id, + arsse_tags.name as name, + arsse_tag_members.subscription as subscription FROM arsse_tag_members join arsse_tags on arsse_tags.id = arsse_tag_members.tag - join arsse_subscriptions on arsse_subscriptions.id = arsse_tag_members.subscription - join arsse_feeds on arsse_feeds.id = arsse_subscriptions.feed WHERE arsse_tags.owner = ? and assigned = 1", "str" )->run($user); diff --git a/tests/cases/Database/SeriesTag.php b/tests/cases/Database/SeriesTag.php index ea40d414..7c5aa1c5 100644 --- a/tests/cases/Database/SeriesTag.php +++ b/tests/cases/Database/SeriesTag.php @@ -378,11 +378,11 @@ trait SeriesTag { public function testSummarizeTags() { $exp = [ - ['tag_id' => 1, 'tag_name' => "Interesting", 'subscription_id' => 1, 'subscription_name' => "Lord of Carrots"], - ['tag_id' => 1, 'tag_name' => "Interesting", 'subscription_id' => 5, 'subscription_name' => "Feed Title"], - ['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 1, 'subscription_name' => "Lord of Carrots"], - ['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 3, 'subscription_name' => "Subscription Title"], - ['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 5, 'subscription_name' => "Feed Title"], + ['id' => 1, 'name' => "Interesting", 'subscription' => 1], + ['id' => 1, 'name' => "Interesting", 'subscription' => 5], + ['id' => 2, 'name' => "Fascinating", 'subscription' => 1], + ['id' => 2, 'name' => "Fascinating", 'subscription' => 3], + ['id' => 2, 'name' => "Fascinating", 'subscription' => 5], ]; $this->assertResult($exp, Arsse::$db->tagSummarize("john.doe@example.com")); }