[4.1] Support class attribute in media custom field#36593
[4.1] Support class attribute in media custom field#36593laoneo wants to merge 8 commits intojoomla:4.1-devfrom
Conversation
|
@astridx can you have a look here if all is correct? |
|
I have tested this item ✅ successfully on e4f4e2d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36593. |
|
I have tested this item ✅ successfully on 87ab096 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36593. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36593. |
|
This looks kinda weird because the class is already being set on the input element within the custom form field. Does it really make sense to have it in both places? |
|
Did you actually test it? The class is not set, as it is not passed into the subform group. It is not rendered at all in any of the elements. |
|
Yes I understand that the FormField layout is clearly correct. I'm asking specifically about the JLayout change as the class is also used here https://github.com/joomla/joomla-cms/pull/36593/files#diff-ffc48fe23d772f6461955e77801148ec01945822ae6574126b6cece7f7bccd26R54 and you're now adding it again on the custom element. |
|
The class is only added to the custom element and nowhere else. The class is delegated to the element from the Formfield but never used there as you can see here https://github.com/joomla/joomla-cms/blob/4.1-dev/layouts/joomla/form/field/media/accessiblemedia.php. So where should then the class being used in your opinion? |
|
Made another test and indeed you are right, the class is used on the input. So it would be wrong to render it two times. |
Pull Request for pr #27712.
Summary of Changes
The accessible media form field doesn't support the class property. This pr fixes it.
Testing Instructions
testclassjoomla-field-mediaelement of the custom field in the dev tools of the browserActual result BEFORE applying this Pull Request
No
testclassis added to the element.Expected result AFTER applying this Pull Request
testclassis added to the element.