diff options
| author | 2025-03-03 23:05:39 +0100 | |
|---|---|---|
| committer | 2025-03-03 23:05:39 +0100 | |
| commit | 03aec8b54e03a767282f6c886113df35bac9cf00 (patch) | |
| tree | 20b4beae079bfcc5627416367e701b7b3deebd11 /app | |
| parent | 78ca659eccc5973282194881a5d2be4edd365440 (diff) | |
Fix dynamic OPML (#7394)
Regression from https://github.com/FreshRSS/FreshRSS/pull/7155
Fix https://github.com/FreshRSS/FreshRSS/issues/7385
Diffstat (limited to 'app')
| -rw-r--r-- | app/Models/Category.php | 9 | ||||
| -rw-r--r-- | app/Services/ImportService.php | 3 |
2 files changed, 9 insertions, 3 deletions
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(); } /** diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 96591053b..d32b62517 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -312,6 +312,9 @@ class FreshRSS_Import_Service { $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); if ($dry_run) { + if ($feed !== null) { + $category->addFeed($feed); + } return $feed; } |
