#19222eval double gives warning if not all 0 after comma are entered
Description
When you enter a double value which has 6 digits after the comma in the database and you do not enter all zeros in the TCE, then you get the warning message:
These fields are not properly updated.
However everything has been stored correctly into the database.
Use this patch.
Or it would be even better to have the number of digits after the comma stored somewhere in TCA to check this too. But the warning message should contain all details if some digit has been lost.
t3lib_tcemain:
function checkStoredRecord($table,$id,$fieldArray,$action) {
global $TCA;
$id = intval($id);
if (is_array($TCA[$table]) && $id) {
$res = $GLOBALS[‘TYPO3_DB’]->exec_SELECTquery(‘*’, $table, ‘uid=’.intval($id));
if ($row = $GLOBALS[‘TYPO3_DB’]->sql_fetch_assoc($res)) {
// Traverse array of values that was inserted into the database and compare with the actually stored value:
$errorString = array();
foreach($fieldArray as $key => $value) {
if ($this->checkStoredRecords_loose && !$value && !$row[$key]) {
// Nothing…
} elseif (strcmp($value,$row[$key])) {
if (strpos($TCA[$table][‘columns’][$key][‘config’][‘eval’],‘double’) !== FALSE && doubleval($value) == doubleval($value)) {
// nothing
} else {
$errorString[] = $key;
}
}
}
(issue imported from #M9181)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.