Bug #19222
closedeval double gives warning if not all 0 after comma are entered
0%
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
Updated by Franz Holzinger over 16 years ago
Some bugfix:
if (strpos($TCA[$table]['columns'][$key]['config']['eval'],'double') !== FALSE && doubleval($value) == doubleval($row[$key])) {
Updated by Franz Holzinger over 16 years ago
You have double2 as eval. Please make more digits possible!
t3lib_tcemain:
case 'double2':
case 'double3':
case 'double4':
case 'double5':
case 'double6':
case 'double7':
case 'double8':
case 'double9':
$theDec = 0;
for ($a=strlen($value); $a>0; $a--) {
if (substr($value,$a-1,1)=='.' || substr($value,$a-1,1)==',') {
$theDec = substr($value,$a);
$value = substr($value,0,$a-1);
break;
}
}
$digits = $func{6};
$theDec = ereg_replace('[^0-9]','',$theDec).'0000000';
$value = intval(str_replace(' ','',$value)).'.'.substr($theDec,0,$digits);
break;
Updated by Dmitry Dulepov over 16 years ago
There is no patch... Patch should be in unified diff format.
Updated by Julian Hofmann over 14 years ago
Making more digits possible would be a nice feature.
patch_20100602_1.diff: new feature.
patch_20100602_2.diff: bugfix as discribed and the new feature.
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
- Is Regression set to No
No feedback for over 90 days.
Updated by Franz Holzinger about 11 years ago
- File patch-19222.diff patch-19222.diff added
This feature is still missing in TYPO3 6.2 alpha2
Updated by Alexander Opitz about 11 years ago
- Status changed from Closed to Needs Feedback
Can you give this patch to Gerrit? See http://wiki.typo3.org/Contribution_Walkthrough_Tutorials
Updated by Alexander Opitz almost 11 years ago
Hi Franz,
can you bring the patch to Gerrit?
Updated by Alexander Opitz almost 10 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Updated by Franz Holzinger almost 10 years ago
Hello, I have written the patch for TYPO3 6.2. So this issue is still present.
Sorry, I have no clue how to put this into Gerrit.