diff --git a/typo3/sysext/form/Classes/Hooks/FormPagePreviewRenderer.php b/typo3/sysext/form/Classes/Hooks/FormPagePreviewRenderer.php index 1dfa402a69d0..db58824890db 100644 --- a/typo3/sysext/form/Classes/Hooks/FormPagePreviewRenderer.php +++ b/typo3/sysext/form/Classes/Hooks/FormPagePreviewRenderer.php @@ -83,21 +83,25 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string ); } } catch (NoSuchFileException $e) { - $this->addInvalidFrameworkConfigurationFlashMessage($e); + $this->addInvalidFrameworkConfigurationFlashMessage($persistenceIdentifier, $e); $formLabel = sprintf( $this->getLanguageService()->sL(self::L10N_PREFIX . 'tt_content.preview.notExistingdPersistenceIdentifier'), $persistenceIdentifier ); } catch (ParseErrorException $e) { - $this->addInvalidFrameworkConfigurationFlashMessage($e); + $this->addInvalidFrameworkConfigurationFlashMessage($persistenceIdentifier, $e); $formLabel = sprintf( $this->getLanguageService()->sL(self::L10N_PREFIX . 'tt_content.preview.invalidFrameworkConfiguration'), $persistenceIdentifier ); } catch (\Exception $e) { // Top level catch - FAL throws top level exceptions on missing files, eg. in getFileInfoByIdentifier() of LocalDriver - $this->addInvalidFrameworkConfigurationFlashMessage($e); - $formLabel = $e->getMessage(); + $this->addInvalidFrameworkConfigurationFlashMessage($persistenceIdentifier, $e); + $formLabel = sprintf( + $this->getLanguageService()->sL(self::L10N_PREFIX . 'tt_content.preview.invalidFrameworkConfiguration.text'), + $persistenceIdentifier, + $e->getMessage() + ); } } else { $formLabel = $this->getLanguageService()->sL(self::L10N_PREFIX . 'tt_content.preview.noPersistenceIdentifier'); @@ -111,13 +115,11 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string return $itemContent; } - /** - * @param \Exception $e - */ - protected function addInvalidFrameworkConfigurationFlashMessage(\Exception $e) + protected function addInvalidFrameworkConfigurationFlashMessage(string $persistenceIdentifier, \Exception $e): void { $messageText = sprintf( $this->getLanguageService()->sL(self::L10N_PREFIX . 'tt_content.preview.invalidFrameworkConfiguration.text'), + $persistenceIdentifier, $e->getMessage() ); diff --git a/typo3/sysext/form/Resources/Private/Language/Database.xlf b/typo3/sysext/form/Resources/Private/Language/Database.xlf index c1cfe8ce3388..efa151ceaf9d 100644 --- a/typo3/sysext/form/Resources/Private/Language/Database.xlf +++ b/typo3/sysext/form/Resources/Private/Language/Database.xlf @@ -46,7 +46,7 @@ "%s" (Invalid ext:form configuration). - Invalid ext:form configuration. %s + Invalid ext:form configuration in form "%s": %s Invalid configuration.