fabarea / rss_display

TYPO3 CMS extension for fetching a RSS / Atom Feed and display its content on the Frontend
Other
12 stars 25 forks source link

Multiple instances of plugin on same page #35

Closed stephan-tittel closed 5 years ago

stephan-tittel commented 5 years ago

Adding 2 rss_display instances with different feed rendering templates (from typo3conf/ext/rss_display/Resources/Private/Templates/Feed/) on the same page does not work. Both instances will render with the same template, so one of the instances does not use the configured template.

Typo3: 9.5.4 / rss_display: 4.2.1

fabarea commented 5 years ago

Ack. It needs to be debugged here. PR welcome.

stephan-tittel commented 5 years ago

It's a bug in the cache handling. The following quick fixes it for me. The correct fix would be to seperate caches of the RSS feeds and their rendered views.

diff --git a/Classes/Controller/FeedController.php b/Classes/Controller/FeedController.php
index 30292cd..777cf95 100644
--- a/Classes/Controller/FeedController.php
+++ b/Classes/Controller/FeedController.php
@@ -134,7 +134,7 @@ class FeedController extends ActionController

     protected function getCacheIdentifier()
     {
-        return md5($this->settings['feedUrl']);
+        return md5($this->settings['feedUrl'] . $this->settings['template'] . $this->settings['numberOfItems']);
     }
fabarea commented 5 years ago

4.2.2 on his way to the TER

stephan-tittel commented 5 years ago

Perfect, thanks!