Bug with "search_banner.search_button_text" shown in search banner theme component

We’re using Search Banner and having this issue.

AFAIK this has only started happening following a recent update.

Any help would be much appreciated. Thank you.

3 Likes

I think this is caused by UX: add optional search button text (#33) · discourse/discourse-search-banner@eeeb391 · GitHub not being as optional as it suggests :laughing:

2 Likes

i can’t reproduce this on my forum and i’m on latest beta

maybe try reinstalling the component (or updating it if you haven’t done so) :thinking:

2 Likes

Yes, we’re experiencing this with all the latest versions for everything installed.

I believe the issue is related to en vs en-GB (in my case, at least).

The issue was reported to us by users (who, I presume, have their language set to en).

Any help would be much appreciated.

3 Likes

Using the en locale is pretty common. Is there a workaround before this bug is fixed? It’s pretty prominent at the top of all pages :face_with_peeking_eye:

I couldn’t repro this issue. :thinking:

Until a problem is identified and fixed, you may use this CSS to hide the button:

.custom-search-banner-wrap .btn.search-icon span {
    display: none;
}

Or alternatively, if you want to keep a clickable text:

.custom-search-banner-wrap .btn.search-icon {
    span {
        display: none;
    }    
    &:before {
        content: "Search";
    }
}

If you set your own locale to the same as your users who experienced the issue, and then refresh the component’s setting pages, is search_banner.search_button_text empty?

1 Like

Thanks @Canapin

I’ve gone with the shorter (first) CSS and that’s done the trick :+1:

Yes, so the problem occurs with en but not with en_GB. If I toggle my interface locale, I see the search_banner.search_button_text box empty in both cases.

Thanks for your help.

2 Likes

hmm strange, I don’t see the issue on any language I set :thinking: — usually this type of issue appears when a language is missing the translation key entirely… but it’s defined in the theme, and should fall back to an empty string unless it has a value added in the settings.

I wonder if there’s a conflict with another theme or a plugin somewhere? If you go to the search banner theme in admin/customize/themes and click the preview button to view it in isolation, does the problem persist there?

2 Likes

Yes, I do see it when using the Preview button (I didn’t need to remove the CSS workaround).

I’ve also tried deleting the theme component and installing it fresh from the git repo, and the problem still persists, I’m afraid.

In case it’s relevant, our default locale is English (UK).

Thanks for your help.

1 Like

I haven’t forgotten about this, but I’ve run out of ideas. I’ve tried multiple languages, including all varieties of English and still can’t manage to reproduce the issue. I’ve also checked some other sites that use this component and they don’t have this issue.

2 Likes