Hi,
I'm trying to integrate a RSS-Feed of a blog on my Site, running Silverstripe 3.0.2 with the actual blog module from github. But the RSSWidget in code/widgets uses the deprecated DataObjectSet in the function getFeedItems() so it doesn't work.
function getFeedItems() {
$output = new DataObjectSet();
// Protection against infinite loops when an RSS widget pointing to this page is added to this page
if(stristr($_SERVER['HTTP_USER_AGENT'], 'SimplePie')) {
return $output;
}
include_once(Director::getAbsFile(SAPPHIRE_DIR . '/thirdparty/simplepie/simplepie.inc'));
$t1 = microtime(true);
$feed = new SimplePie($this->AbsoluteRssUrl, TEMP_FOLDER);
$feed->init();
if($items = $feed->get_items(0, $this->NumberToShow)) {
foreach($items as $item) {
// Cast the Date
$date = new Date('Date');
$date->setValue($item->get_date());
// Cast the Title
$title = new Text('Title');
$title->setValue($item->get_title());
$output->push(new ArrayData(array(
'Title' => $title,
'Date' => $date,
'Link' => $item->get_link()
)));
}
return $output;
}
}
I tried changing to ArrayList but without success.
Is there an update of this widget to be expected?
Thank you for any help.
joko