-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subform-repeatable javascript #39964
Comments
Some time ago I spend some time resurrecting the pr for the modal fields #39351 and asked if this was b/c or not. Didn’t get any answer so I closed it |
not suprised that you got no feedback on #39351 as it contained no information about what changed and why. Looking at it now I still don't know if its just a refactoring or if it indeed resolves the issue I have. Surely (to my non js dev mind) its just a case of having some js to watch if a new row is added and then do what is necessary to configure the field |
@brianteeman you're wrong: #38404 (comment) |
and how is anyone supposed to know that? You ddidn't link to 38404 anywhere in 39351 |
and anyway 38404 is completely unrelated to the issue I am reporting |
Not really, the fields with a modal need to be client side rendered and not prerendered from the php side. Me an Fedik investigated on the possible solutions:
I wasn't expecting
It's the same issue and it's occurring almost in every field that has a modal... |
it is not the same issue. Please re-read what I wrote and not what you think I wrote. and the site I am testing on does NOT have mod_security enabled! |
As Dimitris wrote, almost any modal field will not work in subform. And other fields that have extra javascript logic, should be coded to work in subform as web component or with this event: https://docs.joomla.org/J4.x:ClientSideEvents#joomla:updated |
and thats what I am asking for |
Sadly the docs page for ClientSideEvents almost impossible to find in Google. |
I still don't know what to do with that information
|
There also some examples in https://docs.joomla.org/Subform_form_field_type Like here example joomla-cms/build/media_source/system/js/fields/select-colour.es6.js Lines 41 to 46 in 6798f07
|
Check the comments from me and @Fedik on another field: #35678 (review) |
Thanks @Fedik I will see if I can understand that. What I don't understand why you both keep saying things like this instead of it actually being fixed. So please do not close this. Maybe someone else will have their itch scratched |
It's not that easy and involves some sort of B/C break. For example the selecting of a category has a dynamic function (created on PHP at run time) passed in the URL: joomla-cms/administrator/components/com_categories/src/Field/Modal/CategoryField.php Line 115 in 6798f07
This is wrong on every conceivable way but fixing it involves some level of B/C break. These were the kind of solutions we were looking at, both on the discussion and the RFC. Also, whenever a b/c break is required, people get extremely impolite on their responses, so that's also not very motivating to work on such issues. |
To fix all that in proper way, need to rewrite a looooooot of our js with some b/c break, and I not really in mood of doing it 😄 |
FWIW I just tested #39344 and while (as you state) it is not production ready it does successfully resolve the issue I am reporting here |
This is fixed with: Also see other linked PR in #32663 (comment) If some specific field is broken, then better open a new issue for that field. |
Steps to reproduce the issue
Create a repeatable subform that contains a field that uses js
You can add this code to mod_article_categories.xml as a test
Expected result
A working repeatable field to select the category
Actual result
Only the first occurence works. All subsequent fields do not as the modal is empty
Additional comments
I understand that this is because the modal_category field uses javascript to populate the iframe in the body of the modal but as it does this on page load it does not work for the repeated field because it is not present on page load.
I assume that there could be some javascript that could be instantiated when a subform row is added that would populate the field as required. But I don't have a clue with js to know where to start
cc @Fedik @dgrammatiko
The text was updated successfully, but these errors were encountered: