No Code Attached Yet
avatar cloudfaction
cloudfaction
5 Nov 2021

Steps to reproduce the issue

try to add a showon property with more than 1 option:

showon="jn_val_type:18[OR]jn_val_type:11"

Expected result

show only on the 2 options

Actual result

it shows on all options

System information (as much as possible)

J4 latest (4.04)/ own module.

Additional comments

showon works with just one option, but as soon as i use OR or AND it does not work.

avatar cloudfaction cloudfaction - open - 5 Nov 2021
avatar cloudfaction cloudfaction - change - 5 Nov 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 5 Nov 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Nov 2021
avatar dgrammatiko
dgrammatiko - comment - 5 Nov 2021

What's the input element/form field that holds showon="jn_val_type:18[OR]jn_val_type:11"?

avatar cloudfaction
cloudfaction - comment - 5 Nov 2021

text field


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

avatar cloudfaction
cloudfaction - comment - 5 Nov 2021
avatar dgrammatiko
dgrammatiko - comment - 5 Nov 2021

And what type is the jn_val_type?

avatar cloudfaction
cloudfaction - comment - 5 Nov 2021

that's a list. works like a charm in j3.


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

avatar brianteeman
brianteeman - comment - 5 Nov 2021

This is used in multiple places in core

avatar dgrammatiko
dgrammatiko - comment - 5 Nov 2021

I can not replicate it, it works fine here. My test was on the footer module XML:

Code ```xml mod_footer Joomla! Project July 2006 (C) 2006 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 MOD_FOOTER_XML_DESCRIPTION Joomla\Module\Footer mod_footer.php tmpl language/en-GB/mod_footer.ini language/en-GB/mod_footer.sys.ini
			<field
				name="moduleclass_sfx"
				type="text"
				label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
				rows="3"
				validate="CssIdentifier"
				showon="jn_val_type:18[OR]jn_val_type:11"
			/>

			<field
				name="jn_val_type"
				type="list"
				label="test"
				>
				<option value="0">0</option>
				<option value="1">1</option>
				<option value="11">11</option>
				<option value="18">18</option>
			</field>

			<field
				name="cache"
				type="list"
				label="COM_MODULES_FIELD_CACHING_LABEL"
				default="1"
				filter="integer"
				validate="options"
				>
				<option value="1">JGLOBAL_USE_GLOBAL</option>
				<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
			</field>

			<field
				name="cache_time"
				type="number"
				label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
				default="900"
				filter="integer"
			/>

			<field
				name="cachemode"
				type="hidden"
				default="static"
				>
				<option value="static"></option>
			</field>
		</fieldset>
	</fields>
</config>
```
avatar cloudfaction
cloudfaction - comment - 5 Nov 2021

for me this is inside a subform. see attached part of module xml file


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35968.
avatar cloudfaction
cloudfaction - comment - 5 Nov 2021
avatar dgrammatiko
dgrammatiko - comment - 5 Nov 2021

If you have mentioned that this was on a subform would be easier, so please be more specific when you describe a bug

avatar dgrammatiko
dgrammatiko - comment - 5 Nov 2021

@cloudfaction please test #35972

avatar cloudfaction
cloudfaction - comment - 5 Nov 2021

i downloaded the latest build (https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/35972/downloads/48267/) but showon.es6.js was not in there... i have no local git environment to test. sorry i cannot test this for you.

avatar richard67
richard67 - comment - 5 Nov 2021

@cloudfaction The file modified by this PR is the source file "build/media_source/system/js/showon.es6.js". in the package which you have downloaded, the compiled and minified files can be found in folder "media/system/js". These files are

  • showon.js
  • showon.min.js
  • showon.min.js.gz
  • showon-es5.js
  • showon-es5.min.js
  • showon-es5.min.js.gz

So if you unzip the full package which you have downloaded into some temporary folder and copy the files mentioned above from folder "media/system/js" in the unpacked package folder to the same folder "media/system/js" in your Joomla installation, of course having made a backup of these files before so you can later change back, then you can test the PR.

avatar richard67 richard67 - change - 5 Nov 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-11-05 17:54:15
Closed_By richard67
avatar richard67 richard67 - close - 5 Nov 2021
avatar richard67
richard67 - comment - 5 Nov 2021

Closing as having a pull request. Please test #35972 . Thanks in advance.

Add a Comment

Login with GitHub to post a comment