fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.35k stars 343 forks source link

Cannot export OPML #1438

Closed noiret closed 1 year ago

noiret commented 1 year ago

Hello,

When i try to export my RSS feed on the web U.I the request failed and i have this following error in log : [proxy_fcgi:error] [pid 243725] [client 12.34.56.78:59634] AH01071: Got error 'PHP message: Undefined array key "Youtube"PHP message: [selfoss/src/controllers/Opml/Export.php:150] Base->{closure}()PHP message: [selfoss/index.php:155] controllers\\Opml\\Export->export()PHP message: [selfoss/vendor/bramus/router/src/Bramus/Router/Router.php:440] Bramus\\Router\\Router->invoke()PHP message: [selfoss/vendor/bramus/router/src/Bramus/Router/Router.php:287] Bramus\\Router\\Router->handle()PHP message: [selfoss/index.php:170] Bramus\\Router\\Router->run()'

Selfoss : 2.19 PHP (FPM): 8.1.2 Database : mysql Ver 15.1 Distrib 10.3.38-MariaDB

jtojnar commented 1 year ago

Thanks for reporting, this sounds like Youtube tag does not have a colour associated. Possibly because we forgot to normalize it to lowercase somewhere when saving it. Looking into it.

https://github.com/fossar/selfoss/blob/2.19/src/controllers/Opml/Export.php#L150

jtojnar commented 1 year ago

Looks like MySQL now treats tags as case insensitive. It has originally been fixed by https://github.com/fossar/selfoss/pull/625 but looks like it regressed in 5af5737a6de2da256d4382953a3f9b6a1c43f5f1.

jtojnar commented 1 year ago

In https://github.com/fossar/selfoss/pull/1439, I have fixed what I think is the issue and new development build with the fix should be available shortly.

If you do not want to update yet, you can apply the following patch, which will omit the selfoss-specific color metadata when not available:

--- a/src/controllers/Opml/Export.php
+++ b/src/controllers/Opml/Export.php
@@ -147,6 +147,7 @@ class Export {
             $this->writer->writeAttribute('title', $tag);
             $this->writer->writeAttribute('text', $tag);

+            if (isset($tagColors[$tag]))
             $this->writer->writeAttributeNS('selfoss', 'color', null, $tagColors[$tag]);

             foreach ($children as $source) {
noiret commented 1 year ago

Hello,

I confirm that the patch works \0/ Thank you for your support.