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

[BUGFIX] Fix the broken company filter implementation, Fix the sorting of the filter options

parent 914562e0
No related branches found
No related tags found
No related merge requests found
...@@ -214,7 +214,6 @@ class JoblistController extends ActionController { ...@@ -214,7 +214,6 @@ class JoblistController extends ActionController {
foreach ($filters as $name => &$filter) { foreach ($filters as $name => &$filter) {
if ($name === 'filterByLocation' || $name === 'filterByExperienceLevel' || $name === 'filterByDepartment') { if ($name === 'filterByLocation' || $name === 'filterByExperienceLevel' || $name === 'filterByDepartment') {
$filter = $filter ? GeneralUtility::trimExplode(',', $filter) : NULL; $filter = $filter ? GeneralUtility::trimExplode(',', $filter) : NULL;
if (!$filter) { if (!$filter) {
continue; continue;
} }
......
...@@ -41,16 +41,6 @@ class CompanyRepository extends Repository { ...@@ -41,16 +41,6 @@ class CompanyRepository extends Repository {
/** @var array */ /** @var array */
protected $cache = []; protected $cache = [];
/**
* initializes the object
*/
public function initializeObject(): void {
// $querySettings = $this->createQuery()->getQuerySettings();
// $querySettings->setRespectStoragePage(FALSE);
// $querySettings->setIgnoreEnableFields(TRUE);
// $this->setDefaultQuerySettings($querySettings);
}
/** /**
* Returns all countries filtered by page id * Returns all countries filtered by page id
* *
...@@ -68,11 +58,12 @@ class CompanyRepository extends Repository { ...@@ -68,11 +58,12 @@ class CompanyRepository extends Repository {
$countryName = $company->getCountry(); $countryName = $company->getCountry();
if ($countryName !== '') { if ($countryName !== '') {
// The filtering needs this specific key for some reason. // The filtering needs this specific key for some reason.
$countryArray[$countryName] = $countryName; $countryArray[$countryName] = $company->getUid();
} }
} }
return $countryArray; ksort($countryArray);
return array_flip($countryArray);
} }
/** /**
...@@ -92,11 +83,12 @@ class CompanyRepository extends Repository { ...@@ -92,11 +83,12 @@ class CompanyRepository extends Repository {
$cityName = $company->getCity(); $cityName = $company->getCity();
if ($cityName !== '') { if ($cityName !== '') {
// The filtering needs this specific key for some reason. // The filtering needs this specific key for some reason.
$cityArray[$cityName] = $cityName; $cityArray[$cityName] = $company->getUid();
} }
} }
return $cityArray; ksort($cityArray);
return array_flip($cityArray);
} }
/** /**
...@@ -116,11 +108,12 @@ class CompanyRepository extends Repository { ...@@ -116,11 +108,12 @@ class CompanyRepository extends Repository {
$companyName = $company->getName(); $companyName = $company->getName();
if ($companyName !== '') { if ($companyName !== '') {
// The filtering needs this specific key for some reason. // The filtering needs this specific key for some reason.
$companyArray[$companyName] = $companyName; $companyArray[$companyName] = $company->getUid();
} }
} }
return $companyArray; ksort($companyArray);
return array_flip($companyArray);
} }
/** /**
......
...@@ -224,7 +224,7 @@ class JobRepository extends Repository { ...@@ -224,7 +224,7 @@ class JobRepository extends Repository {
} }
if (isset($filters['filterLocation']) && $filters['filterLocation'] !== '0') { if (isset($filters['filterLocation']) && $filters['filterLocation'] !== '0') {
$constraints[] = $query->equals('company.city', $filters['filterLocation']); $constraints[] = $query->equals('company.uid', $filters['filterLocation']);
} }
if (isset($filters['filterByLocation'])) { if (isset($filters['filterByLocation'])) {
......
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