Project

General

Profile

Actions

Bug #17291

closed

eval double2 makes negative double values positive!

Added by Benjamin Bergmann over 17 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2007-05-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

jsfunc.evalfield.js.diff (400 Bytes) jsfunc.evalfield.js.diff Administrator Admin, 2007-10-19 12:18
jsfunc.evalfield_20071229.diff (649 Bytes) jsfunc.evalfield_20071229.diff Administrator Admin, 2007-12-29 23:35

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #16805: Error while entering a numbers like 50 or 50.00 into a double2 fieldClosed2006-12-22

Actions
Actions #1

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. :)

Actions #2

Updated by Benni Mack over 16 years ago

Hey,

you want to send this patch to the core list?

Actions #3

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?!

Actions #4

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.

Actions #5

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. ;)

Actions #6

Updated by Benni Mack almost 15 years ago

Hey Sylvere,

could you please update your patch?

Thanks!

Actions #7

Updated by Sylvere Stoermann almost 15 years ago

I'll try to do so soon. Sorry, being quite busy at the moment.

Actions #8

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)?

Actions #9

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. :)

Actions #10

Updated by Wouter Wolters over 11 years ago

  • Status changed from Needs Feedback to Resolved

Thanks for checking!

Actions #11

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF