Actions
Bug #65363
closedSet _languageUid to -1 only if the developer hasn't set it himself
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-02-26
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
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.
Actions