summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-11-13 00:23:15 -0500
committerAlessandro Cosentino <cosenal@gmail.com>2012-11-13 00:23:15 -0500
commit24c3d0c92e954cbe76c1742f4155f8488caa1ad1 (patch)
tree7d612d6736b968580f57fb443010b0cc07114e8b
parent0e0944394715a07594f8db4845975b1a2a066709 (diff)
[News] a title of a feed from an opml import should be the one saved in the file
-rw-r--r--ajax/importopml.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/ajax/importopml.php b/ajax/importopml.php
index f0a7d556c..3733f5413 100644
--- a/ajax/importopml.php
+++ b/ajax/importopml.php
@@ -66,7 +66,7 @@ if ($parsed == null) {
$data = $parsed->getData();
-function importFeed($feedurl, $folderid) {
+function importFeed($feedurl, $folderid, $feedtitle) {
global $eventSource;
global $l;
@@ -78,6 +78,7 @@ function importFeed($feedurl, $folderid) {
$feed = OCA\News\Utils::slimFetch($feedurl);
if ($feed !== null) {
+ $feed->setTitle($feedtitle); //we want the title of the feed to be the one from the opml file
$feedid = $feedmapper->save($feed, $folderid);
$itemmapper = new OCA\News\ItemMapper(OCP\USER::getUser());
@@ -137,7 +138,8 @@ function importList($data, $parentid) {
foreach($data as $collection) {
if ($collection instanceOf OCA\News\Feed) {
$feedurl = $collection->getUrl();
- if (importFeed($feedurl, $parentid)) {
+ $feedtitle = $collection->getTitle();
+ if (importFeed($feedurl, $parentid, $feedtitle)) {
$countsuccess++;
}
}