From 0216d73befb72ce69ce7e5596dc86d90858a985d Mon Sep 17 00:00:00 2001 From: Abderahman88 Date: Mon, 20 Mar 2023 23:08:39 +0100 Subject: [PATCH 1/2] change enclosure line --- .../src/services/RssXmlParserService/rssXmlParserService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts b/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts index 58fa6a9c0..ac2d80770 100644 --- a/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts +++ b/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts @@ -198,7 +198,8 @@ export class RssXmlParserService { let item: any = {}; Utils.copyFromXML(xmlItem, item, itemFields); if (xmlItem.enclosure) { - item.enclosure = xmlItem.enclosure[0].$; + //item.enclosure = xmlItem.enclosure[0].$; + item.enclosure = xmlItem.enclosure.$; } if (xmlItem.description) { if (Array.isArray(xmlItem.description)) { From 531789d3cb37c4944a7a503018973f04bab2ab73 Mon Sep 17 00:00:00 2001 From: Abderahman88 Date: Thu, 6 Apr 2023 00:37:01 +0200 Subject: [PATCH 2/2] update readme --- samples/react-rss-reader/README.md | 1 + samples/react-rss-reader/config/package-solution.json | 2 +- .../services/RssXmlParserService/rssXmlParserService.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/react-rss-reader/README.md b/samples/react-rss-reader/README.md index db0f40be5..b770c9c37 100644 --- a/samples/react-rss-reader/README.md +++ b/samples/react-rss-reader/README.md @@ -53,6 +53,7 @@ Version|Date|Comments -------|----|-------- 1.0.0 | Jan 21, 2019 | Initial release 1.0.1 | Nov 22, 2020 | Upgraded to SPFx 1.11 +1.0.2 | April 6, 2023 | Fix bug in Direct request retrieval service ## Minimal Path to Awesome diff --git a/samples/react-rss-reader/config/package-solution.json b/samples/react-rss-reader/config/package-solution.json index c91a93b92..963e3e1cd 100644 --- a/samples/react-rss-reader/config/package-solution.json +++ b/samples/react-rss-reader/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "react-rssreader-client-side-solution", "id": "fcb53167-e0d5-4ed1-9648-149146649aa1", - "version": "1.0.1.0", + "version": "1.0.2.0", "developer": { "name": "Eric Overfield", "privacyUrl": "https://contoso.com/privacy", diff --git a/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts b/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts index ac2d80770..fd48e06cb 100644 --- a/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts +++ b/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts @@ -198,8 +198,12 @@ export class RssXmlParserService { let item: any = {}; Utils.copyFromXML(xmlItem, item, itemFields); if (xmlItem.enclosure) { - //item.enclosure = xmlItem.enclosure[0].$; - item.enclosure = xmlItem.enclosure.$; + if (Array.isArray(xmlItem.enclosure)) { + item.enclosure = xmlItem.enclosure[0].$; + } + else { + item.enclosure = xmlItem.enclosure.$; + } } if (xmlItem.description) { if (Array.isArray(xmlItem.description)) {