Lost functionality after upgrading grav & changing from apache to nginx

I changed from apache to nginx today, and after a few hickups I can see the site just fine.
At the same time there was a grav version update, from 1.1.8 to 1.1.9 iirc.

Now the comments and simplesearch plugins are not working anymore and I’m having a hard time troubleshooting: no log entries, no errors.

the comments don’t show up at all where I reserved a place for them in theme/templates/item.html.twig:

<div id="item" class="block pure-u-2-3">
{% include 'partials/blog_item.html.twig' with {'blog':page.parent, 'truncate':false } %}
{% include 'partials/comments.html.twig' with {'page': page} %}
</div>

partials/comments.html.twig is being evaluated, and if i remove this if-clause:

{% if grav.twig.enable_comments_plugin %}

i can at least see the form, but nothing is submitted, not on the page, not to my email.

the simplesearch plugin is doing equally strange things:
i can enter /search/query:somequery manually, and get results for somequery, but i cannot use the simplesearch_searchbox.html.twig to submit searches. javascript IS enabled.

thanks for reading, I hope there’s a solution to this.

I just tried downloading a fresh “Blog Site” skeleton, and installed the Comments plugin. The comments form shows up correctly, you might want to compare how the Antimatter theme loads it?

you mean under nginx?
the behavior is the same for antimatter and my custom theme.
actually the searchplugin has “caught itself” and is working again.

but not the comments.

i have added 2 lines to comments.html.twig for debugging:

<p>first test</p>
{% if grav.twig.enable_comments_plugin %}
<p>second test</p>

i can see “first test” on the page, but not “second test”.
there are no errors in the logs.
the debug bar shows this for plugins - comments:

array:4 [
  "enabled" => true
  "enable_on_routes" => array:1 [ 
    0 => "/blog"
  ]
  "disable_on_routes" => array:1 [
    0 => "/contact"
  ]
  "form" => array:4 [
    "name" => "comments"
    "fields" => array:7 [
      0 => array:6 [
        "name" => "name"
        "label" => "Name"
        "placeholder" => "Enter your name"
        "autocomplete" => "on"
        "type" => "text"
        "validate" => array:1 [
          "required" => true
        ]
      ]
      1 => array:5 [
        "name" => "email"
        "label" => "Email"
        "placeholder" => "Enter your email address"
        "type" => "email"
        "validate" => array:1 [
          "required" => true
        ]
      ]
      2 => array:5 [
        "name" => "text"
        "label" => "Message"
        "placeholder" => "Enter your message"
        "type" => "textarea"
        "validate" => array:1 [
          "required" => true
        ]
      ]
      3 => array:3 [
        "name" => "date"
        "type" => "hidden"
        "process" => array:1 [
          "fillWithCurrentDateTime" => true
        ]
      ]
      4 => array:3 [
        "name" => "title"
        "type" => "hidden"
        "evaluateDefault" => "grav.page.header.title"
      ]
      5 => array:3 [
        "name" => "lang"
        "type" => "hidden"
        "evaluateDefault" => "grav.language.getLanguage"
      ]
      6 => array:3 [
        "name" => "path"
        "type" => "hidden"
        "evaluateDefault" => "grav.uri.path"
      ]
    ]
    "buttons" => array:1 [
      0 => array:2 [
        "type" => "submit"
        "value" => "Submit"
      ]
    ]
    "process" => array:3 [
      0 => array:1 [
        "email" => array:4 [
          "subject" => "[New Comment] from {{ form.value.name|e }}"
          "body" => "{% include 'forms/data.html.twig' %}"
          "to" => "xxxxxxxxxxxxxxxx"
          "from" => "xxxxxxxxxxxxxxxxxxxx"
        ]
      ]
      1 => array:1 [
        "addComment" => null
      ]
      2 => array:1 [
        "message" => "Thank you for writing your comment!"
      ]
    ]
  ]
]

here’s a list of installed plugins:

archives/
comments/
count-views/
email/
error/
featherlight/
feed/
form/
page-inject/
pagination/
precache/
private/
problems/
random/
readingtime/
simple_contact/
simplesearch/
sitemap/
tagcloud/
taxonomylist/
toc/

maybe one of those is causing trouble?

ok, i got it.
it seems the comments plugin is interpreting the enable_on_routes variable differently now.
i always had it as

enable_on_routes:
  - '/blog'

(this is still the default currently)

changing it to

enable_on_routes:
  - '/'

makes the comments re-appear :slight_smile:

my interpretation:
in my system.yaml, i’m telling grav to hide the ‘/blog’ route in urls.
it would seem that after the grav update, this is also internally applied to the twig environment?
am i correct?

https://github.com/getgrav/grav-plugin-comments/issues/40