Project

General

Profile

Actions

Bug #19222

closed

eval double gives warning if not all 0 after comma are entered

Added by Franz Holzinger over 16 years ago. Updated almost 10 years ago.

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

patch_20100602_1.diff (850 Bytes) patch_20100602_1.diff Administrator Admin, 2010-06-02 12:06
patch_20100602_2.diff (1.3 KB) patch_20100602_2.diff Administrator Admin, 2010-06-02 12:20
patch-19222.diff (1.31 KB) patch-19222.diff Franz Holzinger, 2013-10-02 10:31
Actions

Also available in: Atom PDF