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); } }