Skip to content
Snippets Groups Projects
Commit 728d6e1c authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Fix the addition of the description, canonical and hreflang

parent 4a6214b0
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ class JobTeaserController extends ActionController {
* Get marked offers and display them
*
* @return void
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function indexAction() {
$allowedLocations = [];
......
......@@ -103,7 +103,9 @@ class JoblistController extends ActionController {
}
$GLOBALS['TSFE']->page['titlebyextension'] = $job->getTitle();
$GLOBALS['TSFE']->page['description'] = substr($job->getDescription(), 0, 200);
$GLOBALS['TSFE']->page['description'] = strip_tags(substr($job->getDescription(), 0, 200));
$GLOBALS['TSFE']->page['extensionArgumentsForCanonicalAndHrefLang'] =
'&tx_sgjobs_jobapplication[jobId]=' . $jobId;
$jobs = [$job];
$numberOfPages = 1;
......@@ -171,13 +173,14 @@ class JoblistController extends ActionController {
$job = NULL;
if ($jobId !== NULL) {
// @TODO WTF? Why is this done like this? Localization is done by Extbase itself!
/** @var Job $job */
$job = $this->jobRepository->findByUidLocalized($jobId);
if ($job) {
$GLOBALS['TSFE']->page['titlebyextension'] = $job->getTitle();
$GLOBALS['TSFE']->page['description'] = substr($job->getDescription(), 0, 200);
$GLOBALS['TSFE']->page['description'] = strip_tags(substr($job->getDescription(), 0, 200));
$GLOBALS['TSFE']->page['extensionArgumentsForCanonicalAndHrefLang'] =
'&tx_sgjobs_jobapplication[jobId]=' . $job->getUid();
'&tx_sgjobs_jobapplication[jobId]=' . $jobId;
}
$this->view->assign('job', $job);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment