From e17b4da2a4701ad6192b996cf9a45e1d5f6e7d83 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 8 Nov 2023 12:16:33 +0100 Subject: [PATCH] some adjustments to news item --- src/Bundle/ChillMainBundle/Controller/NewsItemController.php | 2 +- src/Bundle/ChillMainBundle/Entity/NewsItem.php | 2 +- src/Bundle/ChillMainBundle/Form/NewsItemType.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemController.php index af36be9fc..fadaba494 100644 --- a/src/Bundle/ChillMainBundle/Controller/NewsItemController.php +++ b/src/Bundle/ChillMainBundle/Controller/NewsItemController.php @@ -19,7 +19,7 @@ class NewsItemController extends CRUDController { protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { - $query->addOrderBy('e.id', 'ASC'); + $query->addOrderBy('e.startDate', 'ASC'); return parent::orderQuery($action, $query, $request, $paginator); } diff --git a/src/Bundle/ChillMainBundle/Entity/NewsItem.php b/src/Bundle/ChillMainBundle/Entity/NewsItem.php index 35b872c81..b35076101 100644 --- a/src/Bundle/ChillMainBundle/Entity/NewsItem.php +++ b/src/Bundle/ChillMainBundle/Entity/NewsItem.php @@ -64,7 +64,7 @@ class NewsItem implements TrackCreationInterface, TrackUpdateInterface * * @Assert\NotNull */ - private string $type = ''; + private string $type = 'news'; /** * @ORM\Column(type="date_immutable", nullable=false) diff --git a/src/Bundle/ChillMainBundle/Form/NewsItemType.php b/src/Bundle/ChillMainBundle/Form/NewsItemType.php index 0318387ea..b29ea8801 100644 --- a/src/Bundle/ChillMainBundle/Form/NewsItemType.php +++ b/src/Bundle/ChillMainBundle/Form/NewsItemType.php @@ -48,6 +48,6 @@ class NewsItemType extends AbstractType */ public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefault('class', NewsItem::class); + $resolver->setDefault('data_class', NewsItem::class); } }