verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.
Other
137 stars 33 forks source link

Comment form not rendering correctly with a multi-site installation #284

Closed alexhillel closed 1 year ago

alexhillel commented 1 year ago

Describe the bug

I'm running the latest version 2.0.7 on Craft 4.4.9 on a multi-site installation.

I've made no changes to the config or settings of the plugin within a settings file, and put {{ craft.comments.render(entry.id) }} in a channel entry template shared between sites.

The primary site outputs the comment form correctly, but on the site that isn't the primary site, nothing is displayed and the outputted HTML looks like:

<div id="cc-w-604" class="cc-w"><div class="cc-w-i" data-role="comments"></div></div>

Steps to reproduce

  1. Install Craft, and set up in multi-site mode with two sites.
  2. Create a site section active for both sites, and point to a template containing only {{ craft.comments.render(entry.id) }}
  3. Visit the entry's front end URL and the comment form displays on the primary site, but output only the following on the other site:

<div id="cc-w-604" class="cc-w"><div class="cc-w-i" data-role="comments"></div></div>

Craft CMS version

4.4.9

Plugin version

2.0.7

Multi-site?

Yes

Additional context

All other plugins were disabled during my testing.

engram-design commented 1 year ago

I can't seem to replicate this behaviour, sorry.

For the non-primary site, are you logged in? The comment form at the very least should be rendered, but if it isn't I'm wondering if it's because anonymous comments are disabled, and you're not registered as logged in. Although, I don't believe things are different across sites (if you're logged into one, you're logged into another).

alexhillel commented 1 year ago

Ah - this was exactly the issue. I was logged into Craft when accessing via the primary site's URL, but logged out when accessing the secondary site which lives at a separate URL. Many thanks for your help!