comments
comments copied to clipboard
Cannot read properties of null (reading 'cloneNode')
Describe the bug
When I'm not logged in (currentUser) and have Guest commenting disabled I get the following error:
comments.js?v=1741894275:1 Uncaught TypeError: Cannot read properties of null (reading 'cloneNode')
at n.init (comments.js?v=1741894275:1:5532)
at new n (comments.js?v=1741894275:1:194)
This is the line with the error: this.commentForm = this.$baseForm.cloneNode(!0),
this.$baseForm (this.$baseForm = i.querySelector('[data-role="form"]'),) does not exist for me in the DOM.
It works correctly when I am logged in.
Steps to reproduce
- Disable Guest commenting
- Don't be logged in
- Go to a page with comments
Craft CMS version
5.6.11
Plugin version
3.0.6
Multi-site?
No
Additional context
I am using the Template Folder Override, but removed it to test and still get the error.
Fixed for the next release. To get this early, run composer require verbb/comments:"dev-craft-5 as 3.0.6".
Updated in 3.0.7.