From d65f77c081e756997e59e602f49eeea9b09799ff Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 27 Dec 2023 15:18:36 +0100 Subject: More robust assignment of categories to feeds (#5986) Several minor cases, none of which should really be necessary Might help: https://github.com/FreshRSS/FreshRSS/issues/5981 https://github.com/FreshRSS/FreshRSS/issues/5982 --- app/Models/Category.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/Models/Category.php') diff --git a/app/Models/Category.php b/app/Models/Category.php index cc25a1ec0..49ef2d283 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -153,6 +153,7 @@ class FreshRSS_Category extends Minz_Model { if ($this->feeds === null) { $this->feeds = []; } + $feed->_category($this); $this->feeds[] = $feed; $this->sortFeeds(); @@ -210,7 +211,7 @@ class FreshRSS_Category extends Minz_Model { foreach ($dryRunCategory->feeds() as $dryRunFeed) { if (empty($existingFeeds[$dryRunFeed->url()])) { // The feed does not exist in the current category, so add that feed - $dryRunFeed->_categoryId($this->id()); + $dryRunFeed->_category($this); $ok &= ($feedDAO->addFeedObject($dryRunFeed) !== false); } else { $existingFeed = $existingFeeds[$dryRunFeed->url()]; -- cgit v1.2.3