Skip to content

Commit

Permalink
Merge pull request #456 from pimcore/kingjia90-patch-1
Browse files Browse the repository at this point in the history
[Task]: Fix regression Newsletter news
  • Loading branch information
mcop1 authored Apr 11, 2023
2 parents c8f5576 + 3b30124 commit 8b8e43c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Controller/NewsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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->get('type') === 'object') {
$news = News::getById($request->get('id'));
$paramsBag['news'] = $news;
$paramsBag['detailLink'] = $newsLinkGenerator->generate($news, ['document' => $this->document->getProperty('news_default_document')]);

Expand Down

0 comments on commit 8b8e43c

Please sign in to comment.