The following steps can be recreated in most places in the code since it concerns a layout. I have added the code at the beginning of the file index.php in the frontend template.
A input field of type number with the value 34.3
A input field of type number without any values set (see attached Screenshot)
Tested on a new installation of Joomla 3.9.26 Stable on local and a hosted webserver.
Tested with the latest Chrome and Firefox.
Apparently casting the value to float with the locale set to de_DE will create a number with a comma instead of a point. This is then not accepted by the input field of type number, which in most browsers only accepts floats with points.
I have the same problem with the comma instead of the point on Joomla 3.9.26 and 3.9.27-devdev.
In two different hosting companies, two different Joomla's, after entering setlocale(LC_ALL, 'pl_PL');, I have commas instead of the point.
I've tested only:
A input field of type number without any values set (see attached Screenshot)`
I have commas instead of the point.
That's what I expect on a (my) German website. And I didn't get any "invalid" hint with Firefox when I left the field via Tab
.
Therefore you must describe the issue/testing instructions more precisely.
I noticed this problem in RSForm and reCAPTCHA V3 plugin on client hosting.
Everything worked fine on my hosting.
I started looking for a solution to the problem with the plug-in manufacturer and then in hosting.
Hosting told me to add setlocale (LC_ALL, 'en_US.utf8'); to index.php and it worked.
Then I started looking for a problem with Joomla setlocale and that's how I ended up here.
Now I tested according to your instructions in the Protostar template and it does not work in Chrome, Opera, Safari, Brave (blank field).
Only works in Firefox (apparently accepts commas in fractions).
I can reproduce this on Windows by using:
setlocale(LC_ALL, 'Polish');
On a shared hosting environment (CentOS) I can reproduce this with:
setlocale(LC_ALL, 'pl_PL');
This happens on PHP < 8 only. With PHP 8+ there are some changes documented here:
https://php.watch/versions/8.0/float-to-string-locale-independent
Which is in my opinion a feature that has been fixed: PHP shouldn't globally change and localize output on its own. I don't really see a way to fix this in Joomla! at this point
This happens on PHP < 8 only.
I can confirm your find in some other browsers than Firefox. PHP < 8. Whenever a setlocale is used in my example above the field is empty. PHP8: all fine.
On the other hand I don't need a setlocale. Any browser shows me a comma instead of a dot on a German site. But maybe I'm missing something. Saving does not work or whatever?
Forms with fractions do not work on some shared servers in Poland.!
(https://issues.joomla.org/uploads/1/d1dfa4148ee221ea207f08ceed0106f1.png)
Labels |
Added:
No Code Attached Yet
bug
Removed: ? |
Can't confirm with Joomla 3.9.27-dev, PHP7.4, Protostar, with or without setlocale, FireFox: