Bug #18866 ยป bug_8542.diff
t3lib/class.t3lib_tcemain.php (working copy) | ||
---|---|---|
*/
|
||
function insertUpdateDB_preprocessBasedOnFieldType($table, $fieldArray) {
|
||
global $TCA;
|
||
$result = $fieldArray;
|
||
foreach ($fieldArray as $field => $value) {
|
||
switch ($TCA[$table]['columns'][$field]['config']['type']) {
|
||
case 'input':
|
||
// make an implict type conversion from empty string to number 0 if necessary (for Mysql's strict mode)
|
||
if ((t3lib_div::inList($TCA[$table]['columns'][$field]['config']['eval'], 'int') ||
|
||
t3lib_div::inList($TCA[$table]['columns'][$field]['config']['eval'], 'float2')) &&
|
||
$value === '') {
|
||
$result[$field] = 0;
|
||
}
|
||
break;
|
||
// make an implict type conversion from empty string to number 0 if necessary (for Mysql's strict mode)
|
||
case 'group':
|
||
if ($TCA[$table]['columns'][$field]['config']['internal_type'] == 'db' &&
|
||
$value === '') {
|
||
$result[$field] = 0;
|
||
}
|
||
break;
|
||
case 'inline':
|
||
if ($TCA[$table]['columns'][$field]['config']['foreign_field']) {
|
||
if (!t3lib_div::testInt($value)) {
|