? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
3 Oct 2017

Numerous options in the components are for numbers but the xml field type is text. This pr changes them to the correct value of number.

This ensures that a user cannot enter a letter and only numbers. There are no b/c issues as only a numerical character could ever have worked and there is no change in the way the data is stored.

I spotted this when debugging a user's site where they put "five" in the count field instead of "5" and wondered why it didnt work. After this PR that isnt possible

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

bf8222a 3 Oct 2017 avatar brianteeman site
avatar joomla-cms-bot joomla-cms-bot - change - 3 Oct 2017
Category Administration com_admin com_banners com_categories com_contact com_content com_fields com_finder com_messages com_modules com_newsfeeds com_redirect com_tags com_templates com_users Front End com_config
avatar brianteeman brianteeman - open - 3 Oct 2017
avatar brianteeman brianteeman - change - 3 Oct 2017
Status New Pending
avatar infograf768
infograf768 - comment - 3 Oct 2017

Don't we need to do something similar to com_config, i.e.

filter="integer"
validate="number"

and same in the other PR for modules?

avatar brianteeman
brianteeman - comment - 3 Oct 2017

@infograf768 I thought of that but I realised there were a few potential issues

  1. They are not all integers
  2. Not sure and it needs to be checked but if you had previously entered 2.5 as the value then it might have worked and changing it to an integer would break it
  3. Even if they should all be integer (or some other filter) then thats really beyond the scope here as ALL the type="number" fields would also need to be reviewed as many of them also do not have a filter set or use a different way of validating such as a class - we can look at these pr as a first stage
avatar brianteeman brianteeman - change - 3 Oct 2017
Labels Added: ?
avatar Quy Quy - test_item - 3 Oct 2017 - Tested successfully
avatar Quy
Quy - comment - 3 Oct 2017

I have tested this item successfully on fc93e64

Code review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18199.

avatar brianteeman
brianteeman - comment - 13 Oct 2017

fixed conflicts

avatar FPerisa FPerisa - test_item - 24 Oct 2017 - Tested successfully
avatar FPerisa
FPerisa - comment - 24 Oct 2017

I have tested this item successfully on 46f307b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18199.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Oct 2017

@Quy can you please retest?

avatar Quy Quy - test_item - 24 Oct 2017 - Tested successfully
avatar Quy
Quy - comment - 24 Oct 2017

I have tested this item successfully on 46f307b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18199.

avatar Quy
Quy - comment - 24 Oct 2017

I have tested this item successfully on 46f307b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18199.

avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Oct 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Oct 2017

RTC after two successful tests.

avatar mbabker mbabker - change - 24 Oct 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-10-24 21:27:45
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 24 Oct 2017
avatar mbabker mbabker - merge - 24 Oct 2017
avatar brianteeman
brianteeman - comment - 24 Oct 2017

Thanks

avatar Quy
Quy - comment - 25 Oct 2017

@brianteeman When the field is readonly, there is an up/down incremental control that should probably not be displayed. Perhaps revert for these fields.
number

avatar mbabker
mbabker - comment - 25 Oct 2017

That sounds like a bug in our polyfill. Testing another app I have with number fields, those controls do not come up when the field is marked readonly or disabled (and I even went so far as to turn off the CSS to test against plain browser controls).

avatar brianteeman
brianteeman - comment - 25 Oct 2017

Either way it should be created as a new issue

avatar Quy
Quy - comment - 25 Oct 2017

The controls only appear in Firefox, but not in Chrome, and Microsoft Edge on Windows 10 Home.

avatar dgt41
dgt41 - comment - 25 Oct 2017

The problem is this line:

JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true));

It needs to use the browser conditional (IE<9). This needs to be patched in every form field layout or any form field (libraries) and also any instances in the templates

like:

JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9 '));
avatar dgt41
dgt41 - comment - 25 Oct 2017

@Quy please test #18415

avatar infograf768
infograf768 - comment - 31 May 2018

@mbabker
See #20632

Do we really have to use the type number when the field is readonly?

avatar mbabker
mbabker - comment - 31 May 2018

Semantically, it is correct that a field which can ONLY have numerical data use the number input type, regardless of whether it is editable or readonly.

Add a Comment

Login with GitHub to post a comment