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

[BUGFIX] Job ID could be missing inside the CSV file

parent 7b863dd8
No related branches found
No related tags found
No related merge requests found
...@@ -425,9 +425,8 @@ class JoblistController extends ActionController { ...@@ -425,9 +425,8 @@ class JoblistController extends ActionController {
$newName = \date('Ymd-His') . '_' . $applicationData->getJobId() . '-' . $applicationData->getFirstName() $newName = \date('Ymd-His') . '_' . $applicationData->getJobId() . '-' . $applicationData->getFirstName()
. '-' . $applicationData->getLastName(); . '-' . $applicationData->getLastName();
$storage = $resourceFactory->getStorageObject(1); $storage = $resourceFactory->getStorageObject(1);
$applicationFilePath = Environment::getPublicPath() . '/' . $storage->getConfiguration( $applicationFilePath = Environment::getPublicPath() . '/' .
)['basePath'] . 'JobApplication/' . $folderName . $storage->getConfiguration()['basePath'] . 'JobApplication/' . $folderName . '/' . $newName . '.csv';
'/' . $newName . '.csv';
$this->writeApplicationFile($applicationData, $applicationFilePath); $this->writeApplicationFile($applicationData, $applicationFilePath);
} }
...@@ -468,6 +467,7 @@ class JoblistController extends ActionController { ...@@ -468,6 +467,7 @@ class JoblistController extends ActionController {
try { try {
$job = $applyData->getJob(); $job = $applyData->getJob();
if ($job) { if ($job) {
$applyData->setJobId($job->getJobId());
foreach ($job->getCompanies() as $company) { foreach ($job->getCompanies() as $company) {
/** @var Company $company */ /** @var Company $company */
$applyData->setCompany($company); $applyData->setCompany($company);
...@@ -482,9 +482,9 @@ class JoblistController extends ActionController { ...@@ -482,9 +482,9 @@ class JoblistController extends ActionController {
} }
} }
$applyData->setPid($GLOBALS['TSFE']->id);
// look for a configured default job, in case of unsolicited application // look for a configured default job, in case of unsolicited application
if ((!$job || $applyData->getJobId() === NULL) && $applyData->getCompany() !== NULL) { $applyData->setPid($GLOBALS['TSFE']->id);
if ((!$job || !$applyData->getJobId()) && $applyData->getCompany()) {
$applyData->setJobId($applyData->getCompany()->getJobId()); $applyData->setJobId($applyData->getCompany()->getJobId());
} }
......
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