Upgrade to Grav 1.7.46 causes problem with SimpleSearch plugin

I’m using the simplesearch plugin (v2.3.0) to create a filtered collection to be shown in a list, using children.html.twig. Theme used: Hypertext.

All worked fine with Grav 1.7.45. After upgrading to 1.7.46, it seems that the search result that is expected by children.html.twig in {% if search_results %} is empty, so it returns the full collection. Also, the search field isn’t shown at the results page, which should be the case. There are no errors shown in the Grav log, nor in the Apache log.

I could narrow it down to upgrading Grav causing this phenomenon. No plugin update did cause any problem. Tried several times, in different sequences. Also reinstalled the simplesearch plugin.
I Did a compare at github: grav/compare/1.7.45...1.7.46. But I can’t see any change between those versions that could have to do with this specific problem.

In which direction should I investigate further to find a cause?

@Yannnd, I cannot reproduce the issue using Blog Skeleton with Grav 1.7.46

How you could do some self-help:

  • My setup:
    Installed and enabled theme Hypertext + added {% include 'partials/simplesearch_searchbox.html.twig' %} and {% include 'simplesearch_results.html.twig' %} to user/themes/hypertext/templates/partials/base.html.twig
  • Initial search: No results
  • Checked the devtools of the browser => no javascript files loaded
  • Searching where assets are being loaded
  • In /user/themes/hypertext/templates/partials/page/js-css.html.twig, I added the following dumps after line 6:
    {% set allowJS  = page.header.allowJS  == 'enabled' or
                      (page.header.allowJS|default('default') == 'default' and 
                       style.allowJS == '1') %}
    
    {{ dump(allowJS) }}                                 => false
    {{ dump(page.header.allowJS) }}                     => null
    {{ dump(page.header.allowJS|default('default')) }}  => default
    {{ dump(style) }}                                   => array[...]
    {{ dump(style.allowJS) }}                           => false
    
  • Had a look at the default config file user/themes/hypertext/hypertext.yaml: style.allowJs: false
  • Switched to true => Javascript is loaded, all is working fine
  • Went to github of Hypertext and open file hypertext.yaml and then click History.

Question:

  • Did you perhaps also upgrade HyperText and has it been a loooong time ago you installed/upgraded it?
  • What is the content of:
    • /user/env/<yourdomain>/config/themes/hypertext.yaml
    • /user/<yourdomain>/config/themes/hypertext.yaml
    • /user/config/themes/hypertext.yaml
    • /user/themes/hypertext/hypertext.yaml

Hi @anon76427325,

thank you very much for your elaborate answer and the efforts you made to reproduce my problem. Now I’ve got some homework to do :slightly_smiling_face:. I will report back a.s.a.p. what I will find!

1 Like

I’m still investigating. The ‘allowJS’ settings are all ok, it’s a known pitfall when using the Hypertext theme.

I’ll report back when I find something!

Finally it became clear that one setting wasn’t well chosen. In the Admin plugin: Configuration → System → Content → Home page did not point to /home.
(setting home: in /user/config/system.yaml)
Corrected this and the problem was solved.

Thanks to @anon76427325 for pointing me at that setting.