#76202Exception when accessing empty ObjectStorage property (frontend form submitting)
Description
hi,
seems bug from 6.2 version https://forge.typo3.org/issues/62553 is still in typo3 7.6 version. i have a form where following select field is:
<f:form property="anfragen.0.bundesland." id="bundesland" options="{xxxx}" optionvaluefield="uid" optionlabelfield="bundesland" prependoptionlabel="alle Bundesländer" prependoptionvalue></f:form>
if i submit form and do not select any “bundesland” following error is shown:
#1297759968: Exception while property mapping at property path “anfragen.0.bundesland”: PHP Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/kundenhost/public_html/xxx/typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php line 155
here some info from exeption:
#1297759968: Exception while property mapping at property path “anfragen.0.bundesland”: PHP Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/kundenhost/public_html/xxxxxs/typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php line 155 (More information)
TYPO3\CMS\Extbase\Property\Exception thrown in file
/home/kundenhost/public_html/xxxxxs/typo3/sysext/extbase/Classes/Property/PropertyMapper.php in line 128.
21 TYPO3\CMS\Extbase\Property\PropertyMapper::convert(array, “Xxxxxx\Mwxxxxxs\Domain\Model\aaaaaaa”, TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration)
/home/kundenhost/public_html/xxxxxs/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php:
00268: }
00269: try {
00270: $this->value = $this->propertyMapper->convert($rawValue, $this->dataType, $this->propertyMappingConfiguration);
00271: } catch (TargetNotFoundException $e) {
00272: // for optional arguments no exeption is thrown.
20 TYPO3\CMS\Extbase\Mvc\Controller\Argument::setValue(array)
/home/kundenhost/public_html/xxxxxs/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php:
00426: $argumentName = $argument->getName();
00427: if ($this->request->hasArgument($argumentName)) {
00428: $argument->setValue($this->request->getArgument($argumentName));
00429: } elseif ($argument->isRequired()) {
00430: throw new \TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException(‘Required argument “’ . $argumentName . ‘” is not set for ‘ . $this->request->getControllerObjectName() . ‘->’ . $this->request->getControllerActionName() . ‘.’, 1298012500);
19 TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::mapRequestArgumentsToControllerArguments()
/home/kundenhost/public_html/xxxxxs/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php:
00168: call_user_func(array($this, $actionInitializationMethodName));
00169: }
00170: $this->mapRequestArgumentsToControllerArguments();
00171: $this->controllerContext = $this->buildControllerContext();
00172: $this->view = $this->resolveView();
Reviews 1
Related issues 1
History 610
-
Martin Weymayer commented <span data-processor="relativetime" data-value="2016-05-17T07:48:20+00:00" > 05/17/16, 07:48 </span>
-
Martin Weymayer commented <span data-processor="relativetime" data-value="2016-10-11T11:49:54+00:00" > 10/11/16, 11:49 </span>
better solution found – so no core hack necessary:
/** * initialize createanfrage action * * @param void
*/
public function initializeCreateanfrageAction() {$arguments = $this->request->getArguments();
if (intval($arguments[‘newAnfrage’][‘bundesland’]0) = 0) {
unset($arguments['newAnfrage']['bundesland']);
}
if (intval($arguments['newAnfrage']['regionen'][0]) = 0) {
unset($arguments[‘newAnfrage’][‘regionen’]);
}$this->request->setArguments($arguments);} -
Eike Starkmann commented <span data-processor="relativetime" data-value="2017-05-02T18:05:37+00:00" > 05/02/17, 18:05 </span>
I also experienced this issue.
Also all references attached to the object are lost afterwards.
-
Riccardo De Contardi changed category <span data-processor="relativetime" data-value="2018-09-18T16:24:08+00:00" > 09/18/18, 16:24 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95440 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-26T22:30:06+00:00" > 08/26/26, 22:30 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95440 <span data-processor="relativetime" data-value="2026-08-27T06:52:59+00:00" > 08/27/26, 06:52 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95440 <span data-processor="relativetime" data-value="2026-08-27T06:59:09+00:00" > 08/27/26, 06:59 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 95440 <span data-processor="relativetime" data-value="2026-08-27T07:00:21+00:00" > 08/27/26, 07:00 </span>
-
Georg Ringer commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-09-02T14:28:01+00:00" > 09/02/26, 14:28 </span>solved with #100797
-
Georg Ringer changed Related to #100797 <span data-processor="relativetime" data-value="2026-09-02T14:28:06+00:00" > 09/02/26, 14:28 </span>
i solved this for me with following code in typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php line 155 – it seems working:
if(is_object($object)) { $this->isModified = true; $this->storage[spl_object_hash($object)] = array('obj' => $object, 'inf' => $information); $this->positionCounter++; $this->addedObjectsPositions[spl_object_hash($object)] = $this->positionCounter; }