? bug PR-4.3-dev ? Pending

User tests: Successful: 0 Unsuccessful: 0

avatar chmst
chmst
15 Mar 2023

Pull Request for Issue #40116 .

Summary of Changes

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.

Testing Instructions

see #40116.

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

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

avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2023
Category Front End com_content
avatar chmst chmst - open - 15 Mar 2023
avatar chmst chmst - change - 15 Mar 2023
Status New Pending
avatar joomdonation
joomdonation - comment - 15 Mar 2023

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.

avatar brianteeman
brianteeman - comment - 15 Mar 2023

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

avatar joomdonation
joomdonation - comment - 15 Mar 2023

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"
avatar brianteeman
brianteeman - comment - 15 Mar 2023

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.

avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2023
Category Front End com_content Administration com_content Front End
avatar chmst chmst - change - 15 Mar 2023
Labels Added: PR-4.3-dev ?
avatar joomdonation
joomdonation - comment - 15 Mar 2023

@chmst Please don't remove filter="integer", just leave the filter there as how it is.

avatar toivo toivo - test_item - 17 Mar 2023 - Tested successfully
avatar toivo
toivo - comment - 17 Mar 2023

I have tested this item successfully on 414c74c

Tested successfully in Joomla 4.3.0-beta5-dev of 16 March using PHP 8.1.10


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

avatar viocassel viocassel - test_item - 17 Mar 2023 - Tested successfully
avatar viocassel
viocassel - comment - 17 Mar 2023

I have tested this item successfully on 414c74c


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

avatar chmst chmst - change - 29 Mar 2023
Labels Added: ?
avatar joomdonation joomdonation - change - 29 Mar 2023
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 29 Mar 2023

RTC. There were two success tests before and the two last commits were just some code style change.


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

avatar Quy Quy - change - 29 Mar 2023
Labels Added: ?
avatar obuisard obuisard - change - 4 May 2023
Labels Added: bug
Removed: ?
avatar obuisard obuisard - close - 4 May 2023
avatar obuisard obuisard - merge - 4 May 2023
avatar obuisard obuisard - change - 4 May 2023
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
avatar obuisard
obuisard - comment - 4 May 2023

Thank you Christiane @chmst for the PR!

Add a Comment

Login with GitHub to post a comment