1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » RSSWidget uses deprecated DataObjectSet
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 413 Views |
-
RSSWidget uses deprecated DataObjectSet

24 September 2012 at 9:50am
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
-
Re: RSSWidget uses deprecated DataObjectSet

30 September 2012 at 6:31pm
You may wish to add this as an issue on the github account - https://github.com/silverstripe/silverstripe-blog/issues. That way the developers will be notified of the problem. Better yet, submit a pull request to solve the issue. I would imagine all you need to do is swap it for ArrayList as you said, what was the next error you got?
-
Re: RSSWidget uses deprecated DataObjectSet

30 September 2012 at 8:49pm
thanks for your answer, Willr. Turns out the next error has been a problem with the widgetArea which I have solved since.
Swapping DataObjectSet to ArrayList in RSSWidget.php works fine now. Issue solved. -
Re: RSSWidget uses deprecated DataObjectSet

30 September 2012 at 10:28pm
Joko, how did you manages to solve this? I got some nasty errors from simplepie when using code based on RSSWidget.php (wanted to create new RSS-feed from external source). I changed the DataObjectSet to ArrayList, but got "deprecated" error notice. Did you change anything else on the code?
| 413 Views | ||
|
Page:
1
|
Go to Top |



