diff --git a/Classes/Controller/JobController.php b/Classes/Controller/JobController.php index 2f5eb94..208ade5 100644 --- a/Classes/Controller/JobController.php +++ b/Classes/Controller/JobController.php @@ -19,6 +19,7 @@ use TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter; use TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry; use TYPO3\CMS\Extbase\Service\ImageService; +use TYPO3\CMS\Backend\Routing\UriBuilder as BackendUriBuilder; class JobController extends ActionController { @@ -28,7 +29,8 @@ public function __construct( private readonly JobRepository $jobRepository, private readonly ContactRepository $contactRepository, private readonly PersistenceManagerInterface $persistenceManager, - private readonly ImageService $imageService + private readonly ImageService $imageService, + protected readonly BackendUriBuilder $backendUriBuilder, ) { } @@ -163,7 +165,7 @@ public function saveJobAction(Job $job): void $afterSaveJobEvent = new AfterSaveJobEvent($job); $this->eventDispatcher->dispatch($afterSaveJobEvent); - $this->sendEmail($jobs->getUid()); + $this->sendEmail($job->getUid()); $this->redirect('list'); } @@ -182,17 +184,17 @@ public function sendEmail(int $recordId): void public function buildUrl(int $recordId): string { $path = $this->backendUriBuilder - ->buildUriFromRoute( - 'record_edit', - [ - 'edit' => [ - 'tx_academicjobs_domain_model_job' => [ - $recordId => 'edit' - ] - ], - 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') - ] - ); + ->buildUriFromRoute( + 'record_edit', + [ + 'edit' => [ + 'tx_academicjobs_domain_model_job' => [ + $recordId => 'edit' + ] + ], + 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') + ] + ); return GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') . $path; }