[BUGFIX] Cast pageId to integer before storing a preset in EXT:impexp 21/46021/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Sat, 16 Jan 2016 17:07:30 +0000 (18:07 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 16 Jan 2016 18:22:31 +0000 (19:22 +0100)
When storing a export preset in EXT:impexp no pageId is being set when
exporting a single table or record instead of a pagetree branch. Cast
the value for the pageId to integer to avoid MySQL strict mode errors.

Resolves: #72773
Releases: master, 7.6
Change-Id: Id8af258f96680201adaebeb82f488818a3013720
Reviewed-on: https://review.typo3.org/46021
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/impexp/Classes/Domain/Repository/PresetRepository.php

index fab0bf2..3939335 100644 (file)
@@ -95,7 +95,7 @@ class PresetRepository
                     'user_uid' => $beUser->user['uid'],
                     'public' => $inData['preset']['public'],
                     'title' => $inData['preset']['title'],
-                    'item_uid' => $inData['pagetree']['id'],
+                    'item_uid' => (int)$inData['pagetree']['id'],
                     'preset_data' => serialize($inData)
                 );
                 $this->getDatabaseConnection()->exec_INSERTquery('tx_impexp_presets', $fields_values);
@@ -180,4 +180,4 @@ class PresetRepository
     {
         return $GLOBALS['TYPO3_DB'];
     }
-}
\ No newline at end of file
+}