No Code Attached Yet bug
avatar ryanminnig
ryanminnig
5 Dec 2023

screen shot 2023-12-05 at 01 08 58### Steps to reproduce the issue
Insert a checkbox filed type into a filter definition XML file such as filter_model.xml to the effect:

<field name="layout_checkbox"
 type="checkbox"
 label="JFIELD_ALT_LAYOUT_LABEL"
 description="JFIELD_ALT_MODULE_LAYOUT_DESC"
 onchange="this.form.submit();"
/>

Expected result

When the filter bar is activated, a checkbox field appears with text to the right which says "Alternative Layout" (english)

Actual result

When the filter bar is activated a checkbox appears, but no text is displayed. The check action does execute the form submit.

System information (as much as possible)

PHP 8.1.25
Joomla 5.0
Windows 10
WAMP on a local machine

Additional comments

I believe this should be as simple as adding a line to:

\layouts\joomla\form\field\checkbox.php 

to the effect of:

<?php echo $label; ?>

However I am unsure of the ramifications throughout the rest of the project.
The issue is likely with Joomla 4.x as well, however only the 4.4 checkbox.php file was inspected.

screen shot 2023-12-05 at 01 09 35

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar ryanminnig ryanminnig - open - 5 Dec 2023
avatar ryanminnig ryanminnig - change - 5 Dec 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 5 Dec 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Dec 2023
avatar brianteeman
brianteeman - comment - 5 Dec 2023

The label is already there - its just that the filter layout gives all labels a class of visually hidden.

image

Sorry I dont know an easy way to resolve this for your specific case but your proposed solution would not be correct

avatar Fedik
Fedik - comment - 5 Dec 2023

I think it is preferred to use select over checkbox/radio in the filter.
It will be a simple yes/no drop down, kind of:

<field name="layout_checkbox"
 type="list"
 label="JFIELD_ALT_LAYOUT_LABEL"
 description="JFIELD_ALT_MODULE_LAYOUT_DESC"
 onchange="this.form.submit();"
/>
 <option>JFIELD_ALT_LAYOUT_LABEL</option>
 <option value="1">JYES</option>
</field>
avatar ryanminnig
ryanminnig - comment - 5 Dec 2023

Thank you for the suggestion Fedik. The reason I want to use checkbox is because they are more compact and do not require the user to click list dropdown to see all of the options. One thing I did in the short term is to use checkboxes because I can fit 2 checkboxes in the space of 1 drop down list.


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

avatar Hackwar Hackwar - change - 26 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 26 Mar 2024

Add a Comment

Login with GitHub to post a comment