From f9a3c0041ccb408373ae0fdb667bac46b1f498fb Mon Sep 17 00:00:00 2001 From: JiaJia Ji Date: Thu, 6 Apr 2023 12:21:12 +0200 Subject: [PATCH 1/3] task: fix regression newsletter news --- src/Controller/NewsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/NewsController.php b/src/Controller/NewsController.php index 2f93b6d3..6a7f83b7 100644 --- a/src/Controller/NewsController.php +++ b/src/Controller/NewsController.php @@ -89,8 +89,8 @@ public function newsTeaserAction(Request $request): Response public function emailNewsTeaserAction(Request $request, NewsLinkGenerator $newsLinkGenerator): Response { $paramsBag = []; - if ($request->attributes->get('type') === 'object') { - $news = News::getById($request->attributes->getInt('id')); + if ($request->query->get('type') === 'object') { + $news = News::getById($request->query->getInt('id')); $paramsBag['news'] = $news; $paramsBag['detailLink'] = $newsLinkGenerator->generate($news, ['document' => $this->document->getProperty('news_default_document')]); From d39090532f2ffc57ccd0be2f9e0a095ce42402a2 Mon Sep 17 00:00:00 2001 From: JiaJia Ji Date: Fri, 7 Apr 2023 09:33:18 +0200 Subject: [PATCH 2/3] task: basically reverting changes --- src/Controller/NewsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/NewsController.php b/src/Controller/NewsController.php index 6a7f83b7..1a461aa4 100644 --- a/src/Controller/NewsController.php +++ b/src/Controller/NewsController.php @@ -76,8 +76,8 @@ public function detailAction(Request $request, HeadTitle $headTitleHelper, Place public function newsTeaserAction(Request $request): Response { $paramsBag = []; - if ($request->attributes->get('type') === 'object') { - $news = News::getById($request->attributes->getInt('id')); + if ($request->get('type') === 'object') { + $news = News::getById($request->get('id')); $paramsBag['news'] = $news; return $this->render('news/news_teaser.html.twig', $paramsBag); From 3b3012495187a4be9804dfc4fe92d0d1a545afa8 Mon Sep 17 00:00:00 2001 From: JiaJia Ji Date: Fri, 7 Apr 2023 09:38:17 +0200 Subject: [PATCH 3/3] Update NewsController.php --- src/Controller/NewsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/NewsController.php b/src/Controller/NewsController.php index 1a461aa4..6a86e1c6 100644 --- a/src/Controller/NewsController.php +++ b/src/Controller/NewsController.php @@ -89,8 +89,8 @@ public function newsTeaserAction(Request $request): Response public function emailNewsTeaserAction(Request $request, NewsLinkGenerator $newsLinkGenerator): Response { $paramsBag = []; - if ($request->query->get('type') === 'object') { - $news = News::getById($request->query->getInt('id')); + if ($request->get('type') === 'object') { + $news = News::getById($request->get('id')); $paramsBag['news'] = $news; $paramsBag['detailLink'] = $newsLinkGenerator->generate($news, ['document' => $this->document->getProperty('news_default_document')]);