No Code Attached Yet bug
avatar obuisard
obuisard
6 Jul 2023

Steps to reproduce the issue

As I was testing showon in the frontend for custom fields, I noticed a strange behavior when using the negation of values (!) for the condition in the backend, when multiple values are selected.

Expected result

When using a condition such as 'field!:value1', the field the condition is applied to should not show if 'field' has value1 or a combination of values, including value1.

Actual result

Since a picture is worth a thousand words, here is the issue.
I have a checkbox custom field, which can have value1, value2 and value3.
I have created a custom field (icon picker), which will only show if value1 is NOT selected.

screen shot 2023-07-06 at 16 02 21

Now, I head to an article and try my settings.
If the checkbox has value1, the icon field won't show.

screen shot 2023-07-06 at 16 03 47

If the checkbox has value2, the icon field will show. All good until now.

screen shot 2023-07-06 at 16 04 31

Now, if the checkbox has values value1 AND value2, the icon field still shows, while it should not.

screen shot 2023-07-06 at 16 05 23

System information (as much as possible)

Happens in Joomla 4.3 but I suspect it may have been a long-lasting issue.

Additional comments

n/a

avatar obuisard obuisard - open - 6 Jul 2023
avatar obuisard obuisard - change - 6 Jul 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jul 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Jul 2023
avatar brianteeman
brianteeman - comment - 6 Jul 2023

When using a condition such as 'field!:value1', the field the condition is applied to should not show if 'field' has value1 or a combination of values, including value1.

what makes you have that conclusion - I did not make the same conclusion from the docs or the various pull requests.

from my reading nowhere does it say anything about "where x IN y" only "where x EQUALS y" and "where x NOT EQUAKS y"

avatar obuisard
obuisard - comment - 6 Jul 2023

My assumption is that when a condition is set to NOT EQUAL, if the field the condition is based on has multiple values including the value set in the NOT EQUAL' condition, then the field should not show.

The documentation only says (https://docs.joomla.org/Form_field#Showon):

You can also use value 'does not equal' as in showon="field1!:1".
The syntax to show the field "bar" only when "foo" is not equal to "1":

So it is just my assumption in how I think it should behave.

avatar Hackwar Hackwar - change - 28 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 28 Mar 2024
avatar brianteeman
brianteeman - comment - 22 Jul 2024

It looks like this was resolved with #41918

Add a Comment

Login with GitHub to post a comment