Bug #83777

EXT form: uncaught exception in backend page module preview

Added by Andreas Kiessling over 1 year ago. Updated 11 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2018-02-05
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint

Description

To protect the user editable form definitions, i configured a second file mount and moved the yaml files there.

Unfortunately, the backed preview hook does not catch the exception, that the LocalDriver throws, when i open my existing page with the form pointing to the old storage location, see
https://github.com/TYPO3/TYPO3.CMS/blob/160f8db69f423e4db4e645f3c751a707c989db0d/typo3/sysext/form/Classes/Hooks/FormPagePreviewRenderer.php#L89

#1314516809: File /user_upload/requestForm.yaml does not exist. (More information)

InvalidArgumentException thrown in file
/var/www/dist/typo3_src/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php in line 253.

IMHO, the preview hook should catch all exceptions, not just these configured ones, because otherwise i can't even reconfigure / delete the for element with the page module.
I don't know, if the NoSuchFileException will be thrown from another driver? But the message seems also wrong, since $messageText is only declared in the protected function below.

Possible fix:

                } catch (NoSuchFileException $e) {
                    $this->addInvalidFrameworkConfigurationFlashMessage($e);
                    $formLabel = $e->getMessage();
                } catch (ParseErrorException $e) {
                    $this->addInvalidFrameworkConfigurationFlashMessage($e);
                    $formLabel = sprintf(
                        $this->getLanguageService()->sL(self::L10N_PREFIX . 'tt_content.preview.invalidFrameworkConfiguration'),
                        $persistenceIdentifier
                    );
                } catch (\Exception $e) {
                    $this->addInvalidFrameworkConfigurationFlashMessage($e);
                    $formLabel = $e->getMessage();
                }

Associated revisions

Revision a995ab1f (diff)
Added by Ralf Zimmermann over 1 year ago

[BUGFIX] Catch all exceptions in page module of form framework

Catch the toplevel \Exception within the preview renderer hook. This
prevents that the page module shows an exception stacktrace if a
formDefinition - which is referenced within a form plugin - is moved
manually to a different location.
The problem occurs because the TYPO3\CMS\Core\Resource\Driver\LocalDriver
throws some top level exceptions (e.g. within getFileInfoByIdentifier()).

Resolves: #83777
Releases: master, 8.7
Change-Id: I686adb9e38b6f1b0bcb9830fe71d318ba0199a75
Reviewed-on: https://review.typo3.org/55833
Tested-by: TYPO3com <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Sascha Egerer <>
Tested-by: Sascha Egerer <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision c204adbe (diff)
Added by Ralf Zimmermann over 1 year ago

[BUGFIX] Catch all exceptions in page module of form framework

Catch the toplevel \Exception within the preview renderer hook. This
prevents that the page module shows an exception stacktrace if a
formDefinition - which is referenced within a form plugin - is moved
manually to a different location.
The problem occurs because the TYPO3\CMS\Core\Resource\Driver\LocalDriver
throws some top level exceptions (e.g. within getFileInfoByIdentifier()).

Resolves: #83777
Releases: master, 8.7
Change-Id: I686adb9e38b6f1b0bcb9830fe71d318ba0199a75
Reviewed-on: https://review.typo3.org/56056
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Andreas Kiessling over 1 year ago

  • Subject changed from EXT form: uncaught exception in page preview to EXT form: uncaught exception in backend page module preview

#2 Updated by Bjoern Jacob over 1 year ago

  • Sprint Focus set to Remote Sprint

#3 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55833

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55833

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55833

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55833

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56056

#8 Updated by Ralf Zimmermann over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF