26784[!!!][BUGFIX] Cast negative int to boolean (true) in BooleanNode
Commit message
Review
-
Code review CR +2
- Nicole Hummel +2
- Stefan Neufeind +1
- Oliver Hader +1
-
Verified V +2
- Nicole Hummel +2
- Oliver Hader +1
Issues 2
Files 2
Review log 48
Show 23 earlier messages
-
Oliver Klee commented on patch set 1 01/13/14, 14:09
-
Alexander Schnitzler uploaded patch set 2 01/13/14, 14:15
-
Mr. Jenkins commented on patch set 1 01/13/14, 14:15
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12944/ : SUCCESS -
Oliver Klee voted on patch set 2 CR +1 01/13/14, 14:19
-
Alexander Schnitzler commented on patch set 2 01/13/14, 14:20
https://travis-ci.org/alexanderschnitzler/TYPO3-Sandbox/builds/16867613 Travis Build of patchset 1. -
Mr. Jenkins commented on patch set 2 01/13/14, 14:27
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12945/ : SUCCESS -
Bastian Waidelich commented on patch set 2 01/13/14, 14:31
BooleanNode.php:322Why the ctype-check? wouldn't:: if (is_numeric($value)) { return (integer)$value !== 0; } suffice? -
Alexander Schnitzler voted on patch set 2 CR -2 01/13/14, 14:51
-
Oliver Klee commented on patch set 2 01/13/14, 15:06
BooleanNode.php:322ReplyThat depends on whether values like 0.5 or -0.5 should be TRUE or FALSE. -
Ingo Pfennigstorf commented on patch set 2 V -1 CR -1 01/13/14, 15:10
a ctype check was removed in #43726 because not all the "enterprise lts" distributions offer packages for it ...BooleanNode.php:322Beware of ctype ... http://forge.typo3.org/issues/43726 -
Markus Klein commented on patch set 2 01/13/14, 15:31
IMHO this should go down to 4.5 then to have a stable API. Extensions should work on all versions. -
Alexander Schnitzler uploaded patch set 3 01/13/14, 15:56
-
Alexander Schnitzler voted on patch set 3 CR 0 01/13/14, 15:56
-
Alexander Schnitzler commented on patch set 2 01/13/14, 16:01
Reply
Agree with you but let's find a proper solution first. :) -
Oliver Klee voted on patch set 3 CR +1 01/13/14, 16:05
-
Mr. Jenkins commented on patch set 3 CR -1 V -1 01/13/14, 16:08
Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/12950/ : FAILURE -
Alexander Schnitzler commented on patch set 3 CR -2 01/13/14, 16:09
Damn, PHP 5.3 again. Cannot handle the binary notation 0b01. -
Oliver Klee voted on patch set 3 CR 0 01/13/14, 16:09
-
Alexander Schnitzler uploaded patch set 4 01/13/14, 16:13
-
Markus Klein updated the commit message in patch set 4 01/13/14, 16:22
-
Mr. Jenkins commented on patch set 4 01/13/14, 16:28
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12952/ : SUCCESS -
Mr. Jenkins commented on patch set 5 01/13/14, 16:37
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12953/ : SUCCESS -
Alexander Schnitzler commented on patch set 5 01/13/14, 17:07
@Markus: I do not agree on the release versions. Why can't you just stay put and talk to us just as I asked you? If we backported this issue, we would possibly change the behaviour of thousands of applications out there which is not acceptable. Therefore I firstly planned to introduce it to 6.2. So, please, if you do not have better arguments, revert the release versions and let's first talk to Ernesto.
-
Markus Klein commented on patch set 5 01/13/14, 17:51
@Alex: Sorry for that, but I'm a bit confused now, you wrote "Agree with you.." ?? Yes you said, you're looking for solutions, so I thought it would be ok to document this right in place, so it wouldn't be forgotten. (As it always is, when things are just written somewhere within the comments.) So I'm fine of course with reverting this back, I didn't want to spoil your efforts. Nevertheless, assuming this is 6.2 only, how would you write a Fluid template then in an extension which should be 4.5 and 6.2 compatible? Is there a simple solution for that? -
Markus Klein updated the commit message in patch set 5 01/13/14, 17:51
-
Alexander Schnitzler commented on patch set 6 01/13/14, 18:03
Hey Markus, first at all, thanks! Actually I don't even know if this is a change that should go into 6.2, I just added the Releases line. I don't have problems with you patching my patchsets, that's absolutely ok as this is open source software. But in the first place I am searching for the solution to the problem this patch is based on. I want to let Ernesto and the core devs decide if this should go into >= 6.2. I shouldn't have pushed this patchset for CMS, but for TYPO3.Fluid first, but I didn't really think about it when I typed "git push". Anyway, thanks for taking care and what do you think about the actual changes inside this patch? -
Mr. Jenkins commented on patch set 6 01/13/14, 18:08
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12954/ : SUCCESS -
Markus Klein commented on patch set 6 01/13/14, 18:17
Alex, I didn't realize that the line was just intended as a placeholder, I wouldn't have touched it, nor would I have read the commit message at all. ;-) I'd suggest to mark this as [WIP] then, would be clearer IMO. Regarding the code. It looks fine, but from a very naive perspective I'd ask why can't the method simply return (boolean)$value? This would exactly trigger the boolean evaluation process of PHP, which is intended here. (But I'm sure I'm missing an important detail here.) ;-) -
Bastian Waidelich commented on patch set 6 01/13/14, 18:27
Thanks for the work! I won't vote this down, but for the record: I don't think that the current behavior should be changed for following reasons: Whether <f:if condition="{negativeNumber}"> should return TRUE is arguable but it returned FALSE for a long time now and changing that, introduces a breaking behavior that is really hard to detect (we all know that good change logs & release notes aren't a safe protection against this). I'm curious about other opinionsBooleanNode.php:324We should measure the performance impact of using a regex here. And: Even though strings are value types, we shouldn't change the $value itself IMO -
Alexander Schnitzler commented on patch set 6 01/13/14, 18:32
You are right about the WIP. Should have marked it that way. Sorry for that. I talked to Bastian a lot this afternoon about possible solutions, one of these is to just cast it to boolean. If we do so, plain integer and float values inside strings should be evaluated right, but we loose the ability to detect hexadecimal numbers. As for me I do not need this at all, I just want to let this issue be discussed by others. The main issue is, that negative numbers are currently casted to FALSE. If we have a little extra number detection or not isn't that important I guess. -
Markus Klein commented on patch set 6 01/13/14, 18:33
Bastian: The exact same argument could be used the other way round, if one (like me) didn't know that condition="{negVal}" will not resolve to TRUE. Debugging this would be as hard. I actually tend to believe the (expected?) behaviour should be like it is in any other programming language. 0 means FALSE, any bitflip will be TRUE. But it is indeed a very tough problem here regarding backward compatibility. What about introducing a new attribute? Like <f:if test="">? would even be shorter to write... -
Bastian Waidelich commented on patch set 6 01/16/14, 14:01
Hey Markus, thanks for your comments, I moved the discussion to the forge issue and added some prose: http://forge.typo3.org/issues/54243#note-14 ;) Regarding the additional "test" argument - I don't see how this could help with this issue!? -
Stefan Neufeind commented on patch set 6 01/16/14, 22:45
BooleanNode.php:324Reply+1 on both -
Stefan Neufeind commented on patch set 6 02/24/14, 23:23
What do others think, maybe especially Ernesto? -
Oliver Hader commented on patch set 6 CR -1 03/21/14, 23:46
BooleanNode.php:322I'm not sure whether I got that right... but wouln't "return $value != 0;" be enough for int, float and hexdec notations? -
Nicole Hummel uploaded patch set 7 03/22/14, 00:12
-
Nicole Hummel voted on patch set 7 V +1 CR +1 03/22/14, 00:12
-
Mr. Jenkins commented on patch set 7 03/22/14, 00:25
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/15502/ : SUCCESS -
Oliver Hader uploaded patch set 8 03/22/14, 00:53
-
Oliver Hader commented on patch set 8 03/22/14, 00:54
Use an implicit approach without RegEx -
Oliver Hader voted on patch set 8 V +1 CR +1 03/22/14, 00:55
-
Mr. Jenkins commented on patch set 8 03/22/14, 01:07
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/15505/ : SUCCESS -
Stefan Neufeind voted on patch set 8 CR +1 03/22/14, 01:16
-
Nicole Hummel voted on patch set 8 V +2 CR +2 03/22/14, 01:19
-
Nicole Hummel merged patch set 9 03/22/14, 01:19
-
Stefan Neufeind commented on patch set 9 03/22/14, 01:21
no "forward-port" needed - Flow-Fluid does it completely different -
Helmut Hummel commented on patch set 9 03/22/14, 11:17
Is this change pushed to Flow Fluid? -
Stefan Neufeind commented on patch set 9 03/22/14, 17:01
please see my comment. Flow-Fluid has completely different source for this. We might imho either check ourselves or inform somebody of "them" that in the end hopefully both Fluids behave identically. But this is not something that we can port.
BooleanNode.php:323