diff --git a/Classes/XClass/Form/FormEditorController.php b/Classes/XClass/Form/FormEditorController.php index 5517c92809436e9f5029150fe5b5b5a6bb68086d..56e4faf30214988a10db0be0bb2f0ea40be1c924 100644 --- a/Classes/XClass/Form/FormEditorController.php +++ b/Classes/XClass/Form/FormEditorController.php @@ -63,8 +63,8 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll * * @param string $formPersistenceIdentifier * @param FormDefinitionArray $formDefinition - * @internal * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException + * @internal */ public function saveFormAction(string $formPersistenceIdentifier, FormDefinitionArray $formDefinition) { $registrationService = $this->objectManager->get(RegisterService::class); @@ -116,10 +116,16 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll sprintf('Could not access storage with uid "%d".', $storageUid) ); } - $absoluteFilePath = $storage->getFile($fileIdentifier); + $absoluteFilePath = PATH_site . $storage->getFile($fileIdentifier)->getPublicUrl(); } - $parsedYaml = Yaml::parse(file_get_contents($absoluteFilePath)); + try { + $parsedYaml = Yaml::parse(file_get_contents($absoluteFilePath)); + } catch (\Exception $exception) { + throw new \InvalidArgumentException( + sprintf('Could not access storage "%s".', $absoluteFilePath) + ); + } $renderables = self::getFormFieldsRecursive([0 => $parsedYaml]);