Bug #29290

Additional Identity Properties not set on mapping error

Added by Torsten no-lastname-given about 10 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Must have
Category:
ViewHelpers
Target version:
-
Start date:
2011-08-26
Due date:
% Done:

100%

Estimated time:
Has patch:
Yes

Description

After a mapping error occurred, no additional identity properties are set and FLOW3 tries to create a new object.

Could be easily fixed in TYPO3\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper

currently:

    protected function getValue() {
        $value = NULL;

        if ($this->arguments->hasArgument('value')) {
            $value = $this->arguments['value'];
        } elseif ($this->hasMappingErrorOccured()) {
            $value = $this->getLastSubmittedFormData();
        } elseif ($this->isObjectAccessorMode() && $this->viewHelperVariableContainer->exists('TYPO3\Fluid\ViewHelpers\FormViewHelper', 'formObject')) {
            $this->addAdditionalIdentityPropertiesIfNeeded();
            $value = $this->getPropertyValue();
        }
        if (is_object($value)) {
            $identifier = $this->persistenceManager->getIdentifierByObject($value);
            if ($identifier !== NULL) {
                $value = $identifier;
            }
        }
        return $value;
    }

Better:

    protected function getValue() {
        $value = NULL;

        if ($this->arguments->hasArgument('value')) {
            $value = $this->arguments['value'];
        } elseif ($this->hasMappingErrorOccured()) {
            $this->addAdditionalIdentityPropertiesIfNeeded();
            $value = $this->getLastSubmittedFormData();
        } elseif ($this->isObjectAccessorMode() && $this->viewHelperVariableContainer->exists('TYPO3\Fluid\ViewHelpers\FormViewHelper', 'formObject')) {
            $this->addAdditionalIdentityPropertiesIfNeeded();
            $value = $this->getPropertyValue();
        }
        if (is_object($value)) {
            $identifier = $this->persistenceManager->getIdentifierByObject($value);
            if ($identifier !== NULL) {
                $value = $identifier;
            }
        }
        return $value;
    }


Related issues

Related to TYPO3 Core - Bug #59253: Additional Identity Properties not set on mapping errorClosed2014-06-01

Actions
Related to TYPO3 Core - Bug #90331: f:hidden does not add identity fieldsClosedStefan Froemken2020-02-05

Actions
Has duplicate TYPO3.Fluid - Bug #33274: Viewhelpers extending AbstractFormFieldViewHelper should add additionalIdentityProperties even if there is an error on the fieldClosedZach Davis2012-01-18

Actions
Has duplicate TYPO3.Fluid - Bug #46038: Subproperty with Radio fields doesn't render hidden identity propertyClosedBastian Waidelich2013-03-05

Actions
#2

Updated by Bastian Waidelich over 9 years ago

  • Status changed from New to Accepted
  • Assignee set to Bastian Waidelich
#3

Updated by Gerrit Code Review about 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13600

#4

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13600

#5

Updated by Gerrit Code Review about 9 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13600

#6

Updated by Gerrit Code Review about 9 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13600

#7

Updated by Gerrit Code Review almost 9 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13600

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/13600

#9

Updated by Gerrit Code Review over 8 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/13600

#10

Updated by Gerrit Code Review almost 8 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/13600

#11

Updated by Gerrit Code Review almost 8 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/13600

#12

Updated by Gerrit Code Review almost 8 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/13600

#13

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/24068

#14

Updated by Gerrit Code Review almost 8 years ago

Patch set 2 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/24068

#15

Updated by Alexander Berl almost 8 years ago

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

Updated by Stefan Froemken over 1 year ago

  • Related to Bug #90331: f:hidden does not add identity fields added

Also available in: Atom PDF