? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
12 Mar 2021

The Search field on the list of fields and field groups was missing a label.

The field also had a class that doesnt exist and was a remnant from j3

Code review and View generated source to check the search field has a real label and one that can be translated

avatar brianteeman brianteeman - open - 12 Mar 2021
avatar brianteeman brianteeman - change - 12 Mar 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Mar 2021
Category Administration com_fields Language & Strings
avatar sksuryan
sksuryan - comment - 13 Mar 2021

So, I verified that the class is being removed but correct me if I wrong, the updated labels should come at the highlighted place right? If so, they aren't being shown here.

image

Edit:
The problem seems to be in layouts/joomla/searchtools/default/bar.php at line 42.

<label for="filter_search" class="visually-hidden">
<?php if (isset($filters['filter_search']->label)) : ?>
<?php echo Text::_($filters['filter_search']->label); ?>
<?php else : ?>
<?php echo Text::_('JSEARCH_FILTER'); ?>
<?php endif; ?>
</label>

This condition seems to cause the issue.

avatar brianteeman
brianteeman - comment - 13 Mar 2021

The labels are deliberately not visible. Just because you dont display a label on the screen doesn't mean that you don't need to have a label on every input. This is very important for accessibility

avatar sksuryan
sksuryan - comment - 13 Mar 2021

I'm not asking why the labels are hidden, I understand that.

image

Take a look at the text of label, the correct text isn't being displayed and I think it's caused due to this particular code.

Edit:
The problem seems to be in layouts/joomla/searchtools/default/bar.php at line 42.

<label for="filter_search" class="visually-hidden">
<?php if (isset($filters['filter_search']->label)) : ?>
<?php echo Text::_($filters['filter_search']->label); ?>
<?php else : ?>
<?php echo Text::_('JSEARCH_FILTER'); ?>
<?php endif; ?>
</label>

This condition seems to cause the issue.

avatar brianteeman
brianteeman - comment - 13 Mar 2021

Sorry - I understand you know. I will submit a patch shortly

avatar sksuryan
sksuryan - comment - 13 Mar 2021

That's alright, my intention was just to help. Could have added a clearer screenshot though, will keep that in mind. ?

avatar brianteeman
brianteeman - comment - 13 Mar 2021

So this PR is correct. What you have identified is a bigger possible issue effecting many components which I need to look at the reason for that code before proposing a solution in a separate PR

avatar sksuryan
sksuryan - comment - 13 Mar 2021

Yes, @brianteeman would you mind if I create an issue for this?

avatar brianteeman
brianteeman - comment - 13 Mar 2021

No need to create the issue - I will do a full PR when I get to the reasoning

avatar brianteeman
brianteeman - comment - 13 Mar 2021

I have looked back into the history and I cant see why the conditional statement was introduced back in #10090

avatar sksuryan
sksuryan - comment - 13 Mar 2021

I think it's there in case there isn't any label provided. The thinking may have been to check if any label was provided, in case there wasn't any, then to fallback to a standard "Search" label. But since this condition isn't proper, it keeps on falling back to the default. So, We would have to change that particular condition.

avatar brianteeman
brianteeman - comment - 13 Mar 2021

I suspect that at the time the code was introduced there were search fields that didnt have a label so this was a quick and dirty attempt to make sure they all got a label. In which case we can probably just kill the if statement as they all have a valid search label now.

avatar brianteeman
brianteeman - comment - 13 Mar 2021

Or just fix the condition so that it actually does what it was intended to do. Display the search label for the field and if there isnt one to fallback to the global string.

If you want to have a try at creating a PR for that then go for it

avatar sksuryan
sksuryan - comment - 13 Mar 2021

Or just fix the condition so that it actually does what it was intended to do. Display the search label for the field and if there isnt one to fallback to the global string.

If you want to have a try at creating a PR for that then go for it

Yes, I would love to!
I think it's best if we have a fallback just in case a label isn't present.

avatar ceford
ceford - comment - 14 Mar 2021

Just noting that the label does not appear in the source and waiting for a bigger fix before testing.


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

avatar chmst
chmst - comment - 14 Mar 2021

@ceford #32660 and #32670 must be tested together.

avatar sksuryan
sksuryan - comment - 14 Mar 2021

@chmst I think this one would be ready to commit as soon as #32670 is merged which is RTC but haven't been merged yet.

avatar sksuryan sksuryan - test_item - 14 Mar 2021 - Tested successfully
avatar sksuryan
sksuryan - comment - 14 Mar 2021

I have tested this item successfully on 6e3a2c2


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

avatar Quy Quy - test_item - 16 Mar 2021 - Tested successfully
avatar Quy
Quy - comment - 16 Mar 2021

I have tested this item successfully on 6e3a2c2


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

avatar Quy Quy - change - 16 Mar 2021
Status Pending Ready to Commit
Labels Added: ?
avatar Quy
Quy - comment - 16 Mar 2021

RTC


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

avatar wilsonge wilsonge - change - 16 Mar 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-03-16 11:41:15
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 16 Mar 2021
avatar wilsonge wilsonge - merge - 16 Mar 2021
avatar wilsonge
wilsonge - comment - 16 Mar 2021

Thanks!

avatar brianteeman
brianteeman - comment - 16 Mar 2021

thanks

Add a Comment

Login with GitHub to post a comment