Skip to content

sendVerificationMail() error on fresh install #83

@richardthebrave

Description

@richardthebrave

After following the installation instructions with suggested defaults on a local project, a TypeError is thrown when trying to submit a comment from the front end.

Environment

Plugin version: 3.7.7
Kirby version: 5.1.4
PHP: 8.2.0

Steps to Reproduce

  1. Follow instructions from the official docs, using recommended approach (composer, sqlite).
  2. Log into Panel and see Komments view as expected.
  3. Add comment form using default snippets to page.
  4. Submit a new comment on the front end.

Expected Behaviour

Success message on front end. New unpublished comment in the Komments view in the Panel.

Actual Behaviour

Notice "An error occurred" on front-end. TypeError thrown.

Request:

{"comment":"hey","email":"redacted@redacted.org","author":"Mr Comments","author_url":"","url":"","replyTo":"","replyHandle":"","language":"en","pageUuid":"page://3njrkycblqgouuq8"}

Response:

{"status":"error","exception":"TypeError","code":0,"message":"mauricerenck\\Komments\\KommentReceiver::sendVerificationMail(): Argument #1 ($email) must be of type string, null given, called in REDACTED\/site\/plugins\/komments\/plugin\/routes.php on line 81","details":null,"file":"\/site\/plugins\/komments\/lib\/KommentReceiver.php","line":206}

Workaround

  1. Comment out line 81 of komments/plugin/routes.php.
  2. Add 'mauricerenck.komments.spam.verification.filterUnverfied' => false to config.php (or comments are not displayed in Komments panel view).

Additional Context

  • Docs suggest that spam/e-mail verification defaults to false.
  • If verification is explicitly disabled ('mauricerenck.komments.spam.verification.enabled' => false) the issue persists.
  • Enabling and configuring e-mail verification does not fix the issue as described.
  • Note spelling error in filterUnverfied config setting.

Thanks!

Thank you for your work on this plugin, Maurice! Happy to test a fix or provide more details if needed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions