User tests: Successful: 0 Unsuccessful: 0
Pull Request for Issue #40116 .
We have a filter="integer" which allows entering negative values into a number field. In featured blog layout this causes an error.
Suggestion:
Use filter="UINT" where only positive integer values are allowed.
This would make sense everywhere where only positive values are allowed and a user enters negative numbers only accidentally.
see #40116.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Front End com_content |
Status | New | ⇒ | Pending |
Use UINT is also OK. But please also add min=0 to prevent users enter a negative value into the field and has it magically changed to a positive value.
Just tried that and it still changes -2 to 2 on save
Just tried that and it still changes -2 to 2 on save
Ah, Yes. I tried to use the up/down arrow to change the value and it does not allow value smaller than 0. But it does not prevent entering a negative value directly on the field. So in this case, I think we should use number validation as I suggested in the issue report. In case users entered a wrong value for some reasons, they know that it is not allowed
validate="number"
min="0"
In case users entered a wrong value for some reasons, they know that it is not allowed
Definitely. It's never a good idea to change entered data without notification.
Category | Front End com_content | ⇒ | Administration com_content Front End |
Labels |
Added:
PR-4.3-dev
?
|
I have tested this item
Tested successfully in Joomla 4.3.0-beta5-dev of 16 March using PHP 8.1.10
I have tested this item
Labels |
Added:
?
|
Status | Pending | ⇒ | Ready to Commit |
RTC. There were two success tests before and the two last commits were just some code style change.
Labels |
Added:
?
|
Labels |
Added:
bug
Removed: ? |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-05-04 18:16:05 |
Closed_By | ⇒ | obuisard |
Use
UINT
is also OK. But please also add min=0 to prevent users enter a negative value into the field and has it magically changed to a positive value.Also, please make similar changes to category view and also in component options, too.