User tests: Successful: 0 Unsuccessful: 1 Crometor
The new maxlength
field parameter introduced in #14458 is using a text type, therefore it does not validate when saving.
It concerns text and textarea custom fields plugins
If someone enters some text i.e. "something" it is changed to 0
on save.
Changed to type="number"
Use staging. Patch.
After patch one will get:
If someone saves with some alpha string ("something", the field will be saved empty in the database instead of 0
In any case the Tip is really incomplete (not changed in this PR yet).
We have multiple cases:
1.
No value is set in the plugin params
No value is set for the field.
Result => No limit
0 is chosen in the plugin params
No value is set for the field.
Result => No limit
A value is set in the plugin params
No value is set for the field.
Result => The limit is the one set in the plugin params
Any value is set in the field.
Result => The limit is the one set in the field
If value is 0 => No limit.
Therefore we may need a specific tip for the plugin and another one for the field where some of this is explained as what we have now is only:
"The maximum number of characters that can be entered."
We could use for the plugin the existing constant PLG_FIELDS_TEXT_PARAMS_MAXLENGTH_DESC
and for the field
PLG_FIELDS_TEXT_FIELD_PARAMS_MAXLENGTH_DESC
@brianteeman
Any idea to make these tips informative enough?
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Category | Front End Plugins | ⇒ | com_fields Front End Plugins |
Status | Pending | ⇒ | Discussion |
Easy | No | ⇒ | Yes |
I have tested this item
I tested the Patch with the "Joomla! Patch Tester" (3.0.0 Beta 3).
The Issue he descriped was recreatable.
After the Patch all non mathematical relevant letters were not accepted by the input field.
But mathematicall relevant letteres/characters like "e","+","-", "," ,"." could still be filled in.
If you do it like that and save, the value displays and saves nothing, but there is no error.
To prevent this behavior "w3schools" did made a fast check up before saving it.
URL: https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_number
That gives an Error that says you shall give in a real number (I tested it and typed "3+3" and "4,2" in).
The issue is not fully eradicated yet, so I can not approve it as successfully tested.
Try adding step=1
Closing as the fields must have been updated elsewhere to have type=number
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-01-04 19:17:24 |
Closed_By | ⇒ | brianteeman |
Category | Front End Plugins com_fields | ⇒ | Front End Plugins |
PLG_FIELDS_TEXT_PARAMS_MAXLENGTH_DESC="The maximum number of characters that can be entered. Enter 0 for no limit."
But personally I dont see the need for that change.