chore: remove obsolete controller action

This commit is contained in:
Björn Fromme
2025-01-06 15:37:35 +01:00
parent ed97a75678
commit f2422f071c
4 changed files with 4 additions and 54 deletions
-8
View File
@@ -260,11 +260,6 @@ routeEnhancers:
_arguments:
travel_info: travelinfo
travel_date: travelDate
-
routePath: '/{buspro_id}'
_controller: 'Travelinfo::myep'
_arguments:
buspro_id: busProId
-
routePath: '/{travel_code}'
_controller: 'Travelinfo::travelCode'
@@ -278,13 +273,10 @@ routeEnhancers:
routeFieldName: path_segment
travel_date:
type: PassthroughMapper
buspro_id:
type: PassthroughMapper
travel_code:
type: PassthroughMapper
requirements:
travel_date: '\d{4}\-\d{2}\-\d{2}|\d{2}\d{2}\d{4}'
buspro_id: '\d+'
PageTypeSuffix:
type: PageType
default: /
@@ -72,34 +72,7 @@ class TravelinfoController extends ActionController
$this->view->assign('date', $date);
}
public function myepAction(int $busProId)
{
/** @var Date $date */
$date = $this->dateRepository->findOneByBusProId($busProId);
if (null === $date) {
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$GLOBALS['TYPO3_REQUEST'],
'Reisedaten nicht gefunden'
);
throw new ImmediateResponseException($response, 1731071856);
}
$travelinfo = $this->travelInfoRepository->findOneByProduct($date->getProduct());
if (null === $travelinfo) {
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$GLOBALS['TYPO3_REQUEST'],
'Reiseinformationen nicht gefunden'
);
throw new ImmediateResponseException($response, 1731071856);
}
$this->view->assign('travelinfo', $travelinfo);
$this->view->assign('date', $date);
}
public function indexAction(Travelinfo $travelinfo, string $travelDate = null)
public function indexAction(Travelinfo $travelinfo, string $travelDate)
{
$product = $travelinfo->getProduct();
@@ -107,12 +80,8 @@ class TravelinfoController extends ActionController
$travelDate = (\DateTimeImmutable::createFromFormat('dmY', $travelDate))->format('Y-m-d');
}
if (null === $travelDate) {
$date = null;
} else {
/** @var Date $date */
$date = $this->dateRepository->findForProductAndDate($product, $travelDate)->getFirst();
}
/** @var Date $date */
$date = $this->dateRepository->findForProductAndDate($product, $travelDate)->getFirst();
$this->view->assign('travelinfo', $travelinfo);
$this->view->assign('date', $date);
@@ -252,7 +252,7 @@ $boot = function () {
'EP.ep_products',
'travelinfo',
[
'Travelinfo' => 'index,myep,travelCode',
'Travelinfo' => 'index,travelCode',
]
);
@@ -1,11 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
<f:layout name="Default"/>
<f:section name="Main">
<f:render partial="Travelinfo" section="Main" arguments="{_all}"/>
</f:section>
</html>