Bug #65363
closedSet _languageUid to -1 only if the developer hasn't set it himself
100%
Description
When new domain objects get persisted the language field (sys_language_uid) is set to -1 in \TYPO3\CMS\Extbase\Persistence\Generic\Backend::insertObject(). There should be a check if the developer hasn't set it himself.
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php index f3d89c9..8c6e3f0 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php @@ -633,7 +633,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $dataMap = $this->dataMapper->getDataMap(get_class($object)); $row = array(); $this->addCommonFieldsToRow($object, $row); - if ($dataMap->getLanguageIdColumnName() !== NULL) { + if ($dataMap->getLanguageIdColumnName() !== NULL && ($object->_getProperty('_languageUid') === NULL || !$object->_getProperty('_languageUid'))) { $row[$dataMap->getLanguageIdColumnName()] = -1; } if ($parentObject !== NULL && $parentPropertyName) {
If someone has a good idea for a commit message I will submit a patch to gerrit.
Updated by Gerrit Code Review about 9 years 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 http://review.typo3.org/43149
Updated by Gerrit Code Review about 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43149
Updated by Gerrit Code Review about 9 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41595
Updated by Gerrit Code Review about 9 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43427
Updated by Marco Huber about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 86ac2558aa880d5e4995b3cd980d272e53d38034.