[BUGFIX] Extbase: Cast sys_language_uid to integer in updateObject() 53/42653/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Sat, 15 Aug 2015 20:21:40 +0000 (22:21 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 15 Aug 2015 23:31:13 +0000 (01:31 +0200)
commit48334f62772daa3b017b5dae1e9045a6f4903c41
treeeea6b41c912bf119d61a2ea35574f8843037a764
parentdc720bbcd43cd9c7c87f0c7463671cc112c4a54e
[BUGFIX] Extbase: Cast sys_language_uid to integer in updateObject()

Inserting a new object into the database is a two step process in
extbase where the first step is creating a mostly blank record to obtain
the uid for the new record and the second step is creating all related
objects updating the initial record with the final values afterwards.
Due to this process the languageUid in the freshly created object can be
NULL, which is then used without a cast in updateObject(). If the
database enforces not inserting NULL values into columns defined as NOT
NULL this leads to SQL errors.

This is fixed by casting the languageUid to int before using it.

Resolves: #69088
Releases: master
Change-Id: I0c4519520ccc312f68a025a21d3b040c07446992
Reviewed-on: http://review.typo3.org/42653
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php