Create a menu item from type featured articles
Enter -1 (I know it doesn't make sense, but it is possible to do) in leading articles
An error message, because a negative number doesn't make sense or at least no problems on the page
0 Attempt to modify property "params" on null
Joomla 4.2.8
PHP 8.0.4
I checked entering a negative number in the intro articles fields and also with a menu item of type category blog, no errors there.
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
Someone should review the parameter like this one https://github.com/joomla/joomla-cms/blob/4.2-dev/components/com_content/tmpl/featured/default.xml#L56, add validate rule below to prevent wrong data like this being saved
validate="number"
min="0"
@joomdonation the weird part is that the field definition is the same in the blog view and it doesnt give tyhe error there
Exactly @brianteeman
@brianteeman @drmenzelit Because we use different code to getting leading, intro and link items on the two views. For reference
And although there is no fatal error in category blog view, allow negative value for the parameter will cause logical error. For example, if you set Leading Articles parameter to -1, Intro Articles parameter to -3, you will only have 2 intro articles displayed instead of 3 intro articles as expected.
With that said, we should add the suggested validation to prevent this kind of errors.
I agree with @joomdonation that validation of the input is the best. But tried the filter "unit" for that. Please test #40120
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-03-15 09:26:27 |
Closed_By | ⇒ | joomdonation |
confirmed