From 03aec8b54e03a767282f6c886113df35bac9cf00 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 3 Mar 2025 23:05:39 +0100 Subject: Fix dynamic OPML (#7394) Regression from https://github.com/FreshRSS/FreshRSS/pull/7155 Fix https://github.com/FreshRSS/FreshRSS/issues/7385 --- app/Models/Category.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'app/Models/Category.php') diff --git a/app/Models/Category.php b/app/Models/Category.php index 221e8644d..e883a99cf 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -162,11 +162,14 @@ class FreshRSS_Category extends Minz_Model { if ($this->feeds === null) { $this->feeds = []; } - if ($feed->id() !== 0) { - $feed->_category($this); + $feed->_category($this); + if ($feed->id() === 0) { + // Feeds created on a dry run do not have an ID + $this->feeds[] = $feed; + } else { $this->feeds[$feed->id()] = $feed; - $this->sortFeeds(); } + $this->sortFeeds(); } /** -- cgit v1.2.3