[5.4] Fix regex pattern in ShowOnRule for custom fields#47474
[5.4] Fix regex pattern in ShowOnRule for custom fields#47474muhme merged 2 commits intojoomla:5.4-devfrom
Conversation
@LadySolveig Maybe another additional test for a condition I know, it is covered by the last point "check whether other conditions are working as before". But maybe it should be explicitly mentioned? |
|
I have tested this item ✅ successfully on 6e0e00b I also tested foo:[OR]foo:0 or foo:0[OR]foo: and foo!: which all worked as expected. @richard67 I assume you meant foo!: and not !foo: (as !foo: did yield the same error message of Invalid field: Showon Attribute) while foo!: saved and behaved in the expected opposite manner of foo: This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47474. |
|
I have tested this item ✅ successfully on 6e0e00b On a personal note: I recently learned about regular expressions in my Formal Theory of Automata course, so seeing this regex fix in action is really cool. Thanks @LadySolveig : ) This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47474. |
|
Thank you for testing it, @exlemor and @krishnagandhicode! 💚 I really appreciate your personal note. Keep that curiosity and open-mindedness! |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47474. |
|
✅ Final test before merge with JBT
|
|
Thank you @LadySolveig for your contribution. Thank you @richard67 for support. Thank you @exlemor and @krishnagandhicode for testing. |
Pull Request resolves # .
Summary of Changes
As it is a valid condition in the XML form for the showon attribute to have something like
foo:to display a field only if another field is empty, this should also be possible via the custom fields.Testing Instructions
1. Add two custom fields in Articles: Fields (text or textarea - doesn't matter)
2. Add
foo:as showon rule into the field in the options tab3. Additional tests
ORconditions such asfoo:[OR]foo:0orfoo:0[OR]foo:foo!:- the bar field should now only be displayed if the foo field is not emptyActual result BEFORE applying this Pull Request
Rejected by validation.
Expected result AFTER applying this Pull Request
Can be saved and works the same way just like we've been doing all along, by inserting directly into the XML form
The
barfield will now only be displayed if thefoofield is empty.ssitdocker.test_j54_administrator_index.php_option.com_content.view.articles.Laptop.2026-03-25.18.04.09.mp4
Link to documentations
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed