Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Form] Fixed reverse transformation of values in DateTimeToStringTran…
…sformer The parts not given in the format are reset to the corresponding values of the UNIX base timestamp. For example, when parsing with the format "Y-m-d", parsing "2012-05-18" now results in the date "2012-05-18 00:00:00 UTC" instead of "2012-05-18 12:58:27 UTC" as before, where the time part corresponded to the local server time. Another example: When parsing with the format "H:i:s", parsing "12:58:27" now results in "1970-01-01 12:58:27 UTC" instead of "2012-12-13 12:58:27 UTC" as before, where again the date part corresponded to the local server time. This behavior is now consistent with DateTimeToArrayTransformer and DateTimeToLocalizedStringTransformer.
- Loading branch information
Showing
5 changed files
with
145 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b20c5ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to notes in the php manual, the trailing | does not work correctly on all php versions:
"It seems that a pipe ('|') option in formating string works only with PHP version 5.3.8 and newer. We had an issue with it on versions 5.3.2, 5.3.3, 5.3.6. Yet it was fine with 5.3.8 and 5.3.10."
This fix broke my 5.3.3 and 5.5.5 applications. Since 5.5.3 is officially supported by S2 we might consider an adjustment somewhere.
b20c5ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahundiak Can you create a ticket instead so that we don't loose your comment?
b20c5ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahundiak Did you mean to say "5.5.5" and "5.5.3" or was this a typo?
b20c5ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bschussek - PHP version 5.3.3 and 5.3.5 is what I meant. Just happens to be the versions I have on my machines. I'm assuming the | works on newer versions based on the comments in the php manual and based on the notion that the unit tests would fail otherwise. For now, I just commented out the one line and it seems to work.
I will point out that before this commit, I could pass a string like '20120102' (without dashes) to the form element and it would work. Now it needs dashes which is fine. A transformer takes care of that issue.
b20c5ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahundiak Thanks for the report. This is fixed in #6353.