Review main Merged Breaking

33500[!!!][BUGFIX] Use decimal point of current locale

Markus Klein CR +2 V +2 Easy +44 −3 updated 11/26/14, 12:28

Commit message

Let GeneralUtility::formatSize use the current locale's information
about number notation.

This also influences the stdWrap.bytes TypoScript property.

Review

  • Code review CR +2
    • Stefan Froemken +2
    • Stefan Neufeind +1
    • Mathias Schreiber +1
  • Verified V +2
    • Stefan Froemken +2
    • Mathias Schreiber +1

Issues 1

Files 2

Review log 17

  1. Markus Klein uploaded patch set 1 10/24/14, 00:02

  2. Georg Ringer commented on patch set 1 V +1 CR +1 10/24/14, 05:42

    hm isn't that breaking? users might get different output with this bugfix...so add a [!!!] and documentation
  3. Markus Klein uploaded patch set 2 10/24/14, 12:27

  4. Stefan Neufeind commented on patch set 2 CR +1 10/24/14, 21:00

    looked up decimal_point in the php-documentation :-)
  5. Georg Ringer commented on patch set 2 V +1 CR +1 10/25/14, 08:12

    Breaking-60152-formatSizeAdheresLocale.rst:27

    remove the "see"
  6. Markus Klein uploaded patch set 3 10/25/14, 08:25

  7. Stefan Froemken commented on patch set 3 V -1 CR +1 10/25/14, 09:16

    I like this patch, but it doesn't work. I have set systemLocale and useUtf8filesystem in InstallTool. I have set language and language_all to germen locales with and without utf-8. But it still does not work. Then I have written setlocale (LC_ALL, 'de_DE.UTF-8'); directly above formatSize and now it works. Further setlocale (LC_NUMERIC, 'de_DE.UTF-8'); works. I have search the whole core, but we don't make use of LC_ALL and LC_NUMERIC. So, as long as the core does not set these values, it does not make sense to implement this patch.
  8. Markus Klein commented on patch set 3 10/25/14, 10:59

    Ui, good finding, will check. Thanks
  9. Markus Klein uploaded patch set 4 11/18/14, 23:13

  10. Stefan Froemken commented on patch set 4 CR +1 V +1 11/21/14, 23:19

    GeneralUtility.php:964

    Is this enough? In one of my environments I have seen this variable defined with stdClass. So it was an object. Maybe it was a missconfiguration in my system...don't now anymore. What about TYPO3_MODE===FE here?

    GeneralUtility.php:965

    This row wasn't needed if $locale is an empty string. So we should move it into the next condition. Further we should add a little comment. Because it is a little bit missunderstandable that you GET the current value with SETlocale() set to 0.
  11. Markus Klein commented on patch set 4 11/21/14, 23:40

    GeneralUtility.php:964 Reply

    TYPO3_MODE is not always reliable from what I remember. I've never seen TSFE to be stdClass. I consider that as an extreme edge case or even a bug. Generally this method is also called from BE, but I found no way to determine the locale to use for the current BE user's language.

    GeneralUtility.php:965 Reply

    This is true, but it won't hurt either if we do this. It's not even performance critical. The 0 is well documented in the PHP docs, I thought it's not necessary to repeat the docs here.
  12. Christian Kuhn commented on patch set 4 11/22/14, 12:29

    GeneralUtility.php:967

    Why is that needed? FE initializes locales in TypoScriptFrontendController.php to $GLOBALS['TSFE']->config['config']['locale_all'] already.
  13. Markus Klein commented on patch set 4 11/22/14, 12:50

    GeneralUtility.php:967 Reply

    Not quite. It skips LC_NUMERIC, see comment there.
  14. Stefan Neufeind commented on patch set 4 CR +1 11/24/14, 12:13

    GeneralUtility.php:964 Reply

    @StefanF: Please come up with a case where TSFE is stdClass. I also doubt that's a correctly working configuration. (Thus imho we don't need to take it into account here.)
  15. Mathias Schreiber voted on patch set 4 CR +1 V +1 11/26/14, 12:13

  16. Stefan Froemken voted on patch set 4 CR +2 V +2 11/26/14, 12:28

  17. Stefan Froemken merged patch set 4 11/26/14, 12:28