Simplesearch plugin: Input field broken

Hello,
The simplesearch plugin is not working for me, the search box is damaged.
I copied an entire GRAV website and changed logo, colors, and products/service pages, contact, about. The second web site is the same x-corporation skeleton, same inherited theme with same name, only minor changes in the custom.css files an in the md pages.

  1. In the original site, the Simplesearch plugin is working fine.
    SearchWorksFineOnOtherSiteSameTheme

  2. On the copied website is not, please see the attached screen captures.
    SearchProblem

I double checked all simplesearch templates files, they are the same in both websites.

user/plugin/simplesearch
simplesearch.yaml > Identical
simplesearch.php > Identical
languages.yaml > Identical
simplesearch/templates
simplesearch_results.html.twig > Identical
simplesearch_results.json.twig > Identical
simplesearch/templates/partials/
base.html.twig > Identical
simplesearch_item.html.twig > Identical
simplesearch_searchbox.html.twig > Identical

2.1 In simplesearch/languages.yaml PLUGIN_SIMPLESEARCH.SEARCH_PLACEHOLDER is there for spanish, identical on both websites:

es:
  PLUGIN_SIMPLESEARCH:
    SEARCH_PLACEHOLDER: "Buscar …"
    SEARCH_RESULTS: "Resultados de la búsqueda"
    SEARCH_RESULTS_SUMMARY_SINGULAR: "Consulta: <strong>%s</strong> se encontró 1 resultado"
    SEARCH_RESULTS_SUMMARY_PLURAL: "Consulta: <strong>%s</strong> se encontraron %s resultados"
  1. With the browser inspector I checked the differences, on the served pages:
    3.1 On website working:
<div class="head-search">
    <div class="input-group">
        <input type="text" class="form-control header-search-input" placeholder="Buscar …" value="metal" data-header-search-input="/search/query">
            </div>
</div>

3.2 On website not working simplesearch:

<div class="head-search">
<div class="input-group">
        <input type="text" class="form-control header-search-input" placeholder="<span class=" translate-debug"="" data-toggle="tooltip" title="" data-original-title="PLUGIN_SIMPLESEARCH.SEARCH_PLACEHOLDER">Buscar …" value="" data-header-search-input="/search/query" /&gt;
            </div>
</div>

  1. I even copied the simplesearch plugin again from the working website with no luck.

I have not found any related topic in the forum, sorry.
I am lost, any help with this weird issue is appreciated, I did not touch templates nor system or config files, I only changed website data via admin module, custom.css and the user/pages/.
Thanks and Regards
joejac

@joejac, Clearly the new site is using system:languages:debug: true.

It may have changed:

  • manually by you in the new site,
  • or because the new site has a different domain, a different config file may be read when using /user/env/mydomain/config/system.yaml

This translation debug feature is introduced in Grav 1.7.42. See changelog.

When switched on, Grav will surround "STRING.TO.TRANSLATE"|t with a span containing debug info. That’s all nice, but not if the string to be translated is part of an attribute of an element. I consider that to be a bug.

See issue #3752

1 Like

Yes!, as usual, you are right:

system:languages:debug: true

  1. I did not changed it, I avoid touching so many configuration parameters. Many of them I do not know.
  2. Of course the new site has a different domain and the system.yaml is located in:

user/website_domain/config/system.yaml

and it is also located in the usual directory:

user/config/system.yaml

that confuses me because I have 2 system.yaml files in 2 different directories. For this reason I always make the changes in configuration of the GRAV Admin Module.

As usual, @anon76427325 always saving the day. I doubt I would be able to use Grav successfully without @anon76427325 great help.

Te search box is working fine now.

Thank you very much and kind regards.
joejac

1 Like

@joejac,

I have 2 system.yaml files in 2 different directories. For this reason I always make the changes in configuration of the GRAV Admin Module.

The configs inside folder /user/mydomain/config/ (or preferably /user/env/mydomain/config/) overrides the configs found in /user/config/.

That means that if you do not rename foldername /user/mydomain (or /user/env/mydomain) into ‘mynewdomain’:

  • Grav will fallback to configs below /user/config/
  • You will have to set all configs in Admin manually for the new domain.
1 Like

This was my problem, I did not renamed /user/mydomain I deleted the folder since I was making a copy in another hosting account and domain, so for the next time I have to rename /user/mydomain not delete it.

Thanks for the explanation @anon76427325 I am in debt with you :pray:
Regards
joejac

Just an unrelated FYI, TNTsearch is much better than simplesearch. If you have the option, I recommend switching to it or checking it out next time :slight_smile:

1 Like