Skip to content

Commit

Permalink
[BUGFIX] Create application folder if it does not exist
Browse files Browse the repository at this point in the history
(cherry picked from commit 1982fba)
  • Loading branch information
nhovratov committed Sep 27, 2023
1 parent 38be400 commit f37abb4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Classes/Controller/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

namespace Dan\Jobfair\Controller;

use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Resource\StorageRepository;
use TYPO3\CMS\Extbase\Object\Container\Container;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use Dan\Jobfair\Domain\Model\Application;
Expand Down Expand Up @@ -538,6 +540,13 @@ public function deleteAction(Job $job)
*/
public function newApplicationAction(Job $job, Application $newApplication = null)
{
$storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
$defaultStorage = $storageRepository->getDefaultStorage();
$identifier = 'user_upload/tx_jobfair/applications';
$hasFolder = $defaultStorage->hasFolder($identifier);
if ($hasFolder === false) {
$defaultStorage->createFolder($identifier);
}
$loggedInFeuserObject = $this->accessControlService->getFrontendUserObject();
$this->view->assignMultiple(
[
Expand Down

0 comments on commit f37abb4

Please sign in to comment.