Actions
Bug #19222
closedeval double gives warning if not all 0 after comma are entered
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-08-15
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
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)
Files
Actions