joomla/joomla-platform — Issue #858: Feed Caching does not work
Author: Chraneco
Created: 2012-02-11 14:24:14+00:00
State: open

Test instructions:

- Set up a new instance of Joomla! with default sample data
- Create a new feed module in backend on position 'cpanel' with your favourite feed.
- Go to control panel and ensure that the feed module is displayed correctly
- Go to global configuration and enable caching
- Go to control panel and refresh the page
-> An empty feed module will be displayed

I had a look at this and found out that the bug is in method 'getFeedParser' of class 'JFactory'. The cache controller 'callback' is used there for caching the feed using the 'init' method of SimplePie library as the callback function.

This produces two problems:
1. The return value of method 'init' is only a boolean which gets cached then. So the gain of that isn't very much.
2. 'getFeedParser' returns an instance of the SimplePie library. So if the library was initialised with 'init' afore, the 'get' method of the cache won't execute 'init' again. Thus, an uninitialised SimpliePie object is returned and so we get an empty feed module.