[4.1] Form list with showon attributes should load the show on script#37300
[4.1] Form list with showon attributes should load the show on script#37300dgrammatiko wants to merge 15 commits intojoomla:4.1-devfrom
Conversation
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
|
I just tested this patch and can confirm it fixes the issue. |
|
@toroworx Could you go to the PR in the issue tracker here https://issues.joomla.org/tracker/joomla-cms/37300 and use the "Test this" button to submit your test result? Thanks in advance. |
|
I have tested this item ✅ successfully on ac8bed2 I just found out though: to replicate the issue, you have to make sure there's not a field with a showon attribute, else this will load the showon.min.js script, preventing you from replicating the issue. Nevertheless the patch works fine. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37300. |
|
I have changed this PR so it will use the Platform wide joomla-cms/libraries/src/Form/FormField.php Lines 1070 to 1075 in 29ec453 joomla-cms/layouts/joomla/form/renderfield.php Lines 28 to 33 in 29ec453 |
|
@toroworx Could you test again with the latest changes? Thanks in advance. |
|
Seems to be broken right now. Test instructions:
|
|
@toroworx Have you applied the changes in ListField.php AND also reverted the List.php to the original state like without this PR? Or have you maybe forgotten the latter? |
|
@toroworx what do you expect instead of that the status are hidden? For me it works exact the same way as you did describe it in the last comment which is for me the expected behavior. |
|
@richard67 I've used the Joomla Patch Tester. I reverted the patch, fetched data, and applied the patch. @laoneo did you refresh after step 5? The definition of broken is: not hiding the If on the page somewhere |
|
@toroworx you're right the latest patch is not working as expected @laoneo there's problem with the List field (which is also the base for many other fields). The showon is loaded only if the field is declaring a showon attribute in the root, if it is in a nested option the showon is not loaded. This affects many other fields. My first approach was naive, eg have a new option passed in the layout data but I realised that will not work for any of the fields that are extending the List field. Also I have no clue how this can be achieved without some refactoring (eg the getLayoutData or the getOptions fn) |
|
Thanks for clarification, now I got it. |
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
|
@dgrammatiko did your last changes fix the bug which was found by @toroworx? |
|
@laoneo it should solve the reported issue, if not then it should be closed |
|
/edited: I appreciate your pull request, but why do you suggest it's fixed before testing it? With the provided instructions it shouldn't take long. |
I did and the showon file was loaded. Anyways someone else could have better lack with this |
Okay, I'm sorry then. Weird it did work for you and not for me. @dgrammatiko I've edited your approach and this works for me now. Can you please review the approach? |
|
I‘ve re-opened the issue. But @dgrammatiko could you check the commit linked by @toroworx ? |
|
Thanks for reopening @richard67. I don't want to hijack anything, if I'll need to close something please let me know! |
Pull Request for Issue #37299
Summary of Changes
Testing Instructions
\joomla-cms\administrator\components\com_banners\forms\banner.xml/administrator/index.php?option=com_banners&view=banner&layout=editshowon="state!:X"line from the code above. Press CTRL+F5.Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Documentation Changes Required