Project

General

Profile

Actions

Bug #105996

open

FileUpload validation may lead to uninitialized model and errors

Added by Garvin Hicking 14 days ago. Updated 10 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
Start date:
2025-01-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
fileupload propertymapper objectaccess
Complexity:
Is Regression:
Sprint Focus:

Description

If an extbase model is created which solely has an optional FileUpload property required=false) addressed through <f:form> CRUD handling, the way how the FileUpload validation takes place could leave an uninitialized Entity, and fail on follow-up validation because no actual Entity could have been created.

As soon as at least one other property is involved, this problem will not occur. This means, the scenario is rather unlikely to occur in "real-life". But developers trying out the FileUpload validation handling may only try this out with a single property and then run into problems, which is why the issue needs to be addressed.

The reason for this is related to the PropertyMapper, which does not get involved because the FileUpload property works in a differently timed aspect of object persistence.

Relevant parts of the stack-trace:

component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": 
Oops, an error occurred! Request: 4824d485f0adf- Exception: TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath(): Argument #1 ($subject) must be of type object|array, null given, called in typo3\sysext\extbase\Classes\Mvc\Controller\FileHandlingServiceConfiguration.php on line 140, in file typo3\sysext\frontend\Classes\ContentObject\ContentObjectRenderer.php:667 
- {"exception":"TypeError: TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath(): Argument #1 ($subject) must be of type object|array, null given, called in typo3\sysext\extbase\Classes\Mvc\Controller\FileHandlingServiceConfiguration.php on line 140 and defined in typo3\sysext\extbase\Classes\Reflection\ObjectAccess.php:128

Stack trace:
#0 typo3\sysext\extbase\Classes\Mvc\Controller\FileHandlingServiceConfiguration.php(140): TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath(NULL, 'singlefile')

#1 typo3\sysext\extbase\Classes\Mvc\Controller\Argument.php(329): TYPO3\CMS\Extbase\Mvc\Controller\FileHandlingServiceConfiguration->validateFileOperations(Object(TYPO3\CMS\Extbase\Mvc\Controller\Argument))

#2 typo3\sysext\extbase\Classes\Mvc\Controller\Arguments.php(268): TYPO3\CMS\Extbase\Mvc\Controller\Argument->validate()

#3 typo3\sysext\extbase\Classes\Mvc\Controller\ActionController.php(459): TYPO3\CMS\Extbase\Mvc\Controller\Arguments->validate()

#4 typo3\sysext\extbase\Classes\Mvc\Controller\ActionController.php(390): TYPO3\CMS\Extbase\Mvc\Controller\ActionController->callActionMethod(Object(TYPO3\CMS\Extbase\Mvc\Request))

#5 typo3\sysext\extbase\Classes\Mvc\Dispatcher.php(68): TYPO3\CMS\Extbase\Mvc\Controller\ActionController->processRequest(Object(TYPO3\CMS\Extbase\Mvc\Request))

#6 typo3\sysext\extbase\Classes\Core\Bootstrap.php(152): TYPO3\CMS\Extbase\Mvc\Dispatcher->dispatch(Object(TYPO3\CMS\Extbase\Mvc\Request))

#7 typo3\sysext\extbase\Classes\Core\Bootstrap.php(131): TYPO3\CMS\Extbase\Core\Bootstrap->handleFrontendRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
Actions #1

Updated by Gerrit Code Review 10 days ago

  • Status changed from Accepted to Under Review

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

Actions

Also available in: Atom PDF