Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[com_fields] Changing text type to number type #15020

Closed
wants to merge 1 commit into from

Conversation

infograf768
Copy link
Member

@infograf768 infograf768 commented Mar 31, 2017

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.

Summary of Changes

Changed to type="number"

Testing Instructions

Use staging. Patch.
After patch one will get:

screen shot 2017-03-31 at 09 24 43

screen shot 2017-03-31 at 09 25 08

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?

@laoneo @Bakual

@brianteeman
Copy link
Contributor

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.

@Crometor
Copy link

I have tested this item 🔴 unsuccessfully on 6d46ae6

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.

@icampus


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

@brianteeman
Copy link
Contributor

Try adding step=1

@brianteeman
Copy link
Contributor

Closing as the fields must have been updated elsewhere to have type=number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants