From 2fb592646961039a8891d3c4f03fe474aba48bbf Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Sun, 20 Dec 2015 16:07:10 +0100
Subject: [PATCH] [BUGFIX] Fix the url handling for the feed file

---
 Classes/Controller/NewsFeedController.php       |  7 +------
 Configuration/TypoScript/Frontend/setup.txt     |  1 +
 Resources/Private/Templates/NewsFeed/Index.html | 10 +++++-----
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/Classes/Controller/NewsFeedController.php b/Classes/Controller/NewsFeedController.php
index 6320506..0d16ff8 100644
--- a/Classes/Controller/NewsFeedController.php
+++ b/Classes/Controller/NewsFeedController.php
@@ -43,12 +43,7 @@ class NewsFeedController extends AbstractController {
 	 */
 	public function indexAction() {
 		$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategory(10, FALSE);
-		$this->view->assignMultiple(
-			[
-				'news' => $news,
-				'absoluteUrl' => $GLOBALS['TSFE']->absRefPrefix
-			]
-		);
+		$this->view->assign('news', $news);
 	}
 }
 
diff --git a/Configuration/TypoScript/Frontend/setup.txt b/Configuration/TypoScript/Frontend/setup.txt
index af4e5d0..efce6d2 100644
--- a/Configuration/TypoScript/Frontend/setup.txt
+++ b/Configuration/TypoScript/Frontend/setup.txt
@@ -46,6 +46,7 @@ plugin.tx_sgnews {
 	settings {
 		siteName =
 		facebookPublisher =
+		rootpageId = 1
 		newsLimitPerPage = {$plugin.tx_sgnews.settings.newsLimitPerPage}
 	}
 
diff --git a/Resources/Private/Templates/NewsFeed/Index.html b/Resources/Private/Templates/NewsFeed/Index.html
index 98f726d..3261b90 100644
--- a/Resources/Private/Templates/NewsFeed/Index.html
+++ b/Resources/Private/Templates/NewsFeed/Index.html
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>{namespace sg=SGalinski\SgNews\ViewHelpers}
 <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
 	<title>News Feed</title>
-	<link href="{absoluteUrl}" />
-	<link rel="self" type="application/atom+xml" href="{absoluteUrl}news.xml" />
-	<id>{absoluteUrl}news.xml</id>
+	<link href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}" />
+	<link rel="self" type="application/atom+xml" href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1', pageType: '78906523')}" />
+	<id>{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}news.xml</id>
 	<updated>{news.0.lastUpdated -> f:format.date(format: "Y-m-d\TH:i:s+01:00")}</updated>
 	<subtitle type="html">News Feed - {absoluteUrl}</subtitle>
 	<author>
@@ -12,8 +12,8 @@
 	<f:for each="{news}" as="singleNews">
 		<entry>
 			<title>{singleNews.subtitleWithFallbackToTitle}</title>
-			<link href="{f:uri.page(pageUid: '{singleNews.uid}')}" />
-			<id>{f:uri.page(pageUid: '{singleNews.uid}')}</id>
+			<link href="{f:uri.page(pageUid: '{singleNews.uid}', absolute: '1')}" />
+			<id>{f:uri.page(pageUid: '{singleNews.uid}', absolute: '1')}</id>
 			<updated>{singleNews.lastUpdated -> f:format.date(format: "Y-m-d\TH:i:s+01:00")}</updated>
 			<summary type="html">{singleNews.description}</summary>
 		</entry>
-- 
GitLab