Bug #17291
closedeval double2 makes negative double values positive!
0%
Description
in tca-fields with eval = double2 negative values like -0.18 are changed to the positive value 0.18.
values lower than or equal to -1.0 are stored correctly
(issue imported from #M5595)
Files
Updated by Sylvere Stoermann about 17 years ago
My first patch (October 2007) had some side-effects (e.g. entering '-4' would yield '--4.00'). I made a new patch which alters the logic of evalFunc_parseDouble() [instead of changing evalFunc_parseInt() as my first patch did].
After splitting the 'value' (which is then stored in theVal) from the decimals, an if-statement checks if theVal is starting with a minus-sign. If so, it's chopped off the beginning of theVal and the var neg is set to '-'.
The "construction" of the new value is unchanged. However, after this is done, it is multiplied by 100 to check for an actual value (not zero) and neg is prepended. This is a sanity check to prevent '-0.00' as result.
Thus you get this (entered => result):
'' => '0' [because of if (!value) return 0;]
'-' => '0.00'
'-0' => '0.00'
'-.4' => '-0.40'
'-4' => '-4.00'
'.4' => '0.40'
'4' => '4.00'
Ergo: It works as it should without interfering with evalFunc_parseInt().
Hopefully, some of you can thouroughly test it so the patch may find its way into the core. :)
Updated by Benni Mack over 16 years ago
Hey,
you want to send this patch to the core list?
Updated by Sylvere Stoermann over 16 years ago
I tried, but the core list is closed to outsiders... :(
What address should I send my patch to?!
Updated by Benni Mack over 16 years ago
Hey Sylvere,
read this: http://typo3.org/teams/core/core-mailinglist-rules/. Then send an email to the newsgroup "typo3.teams.core" with the info.
Updated by Sylvere Stoermann over 16 years ago
Thank you very much. My error was to try to send it to the listfielders-mailing-list directly instead of sending it to the newsgroup.
Feels good to contribute, at last. ;)
Updated by Benni Mack over 14 years ago
Hey Sylvere,
could you please update your patch?
Thanks!
Updated by Sylvere Stoermann over 14 years ago
I'll try to do so soon. Sorry, being quite busy at the moment.
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 Sylvere Stoermann over 11 years ago
I have tested the issue in 4.5 and 6.1 - it does not exist anymore.
The issue can be closed.
Looking at jsfunc.evalfield.js apparently my patch's logic was applied in a more elegant manner, effectively eliminating this bug. I didn't bother to check by whom and when, but it has been done. :)
Updated by Wouter Wolters over 11 years ago
- Status changed from Needs Feedback to Resolved
Thanks for checking!