VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
409 stars 64 forks source link

Unable to edit or create any model with a "Comments" field due to a type error #175

Closed mjadczuk closed 1 year ago

mjadczuk commented 1 year ago

I've installed the plugin according to the README instruction, enabled it for specific models, and added the custom "Comments" field for them in the content type builder via admin panel. When I'm trying to create a new model or edit an existing model with the "Comments" field, it displays a generic error page and the following error is printed in the console:

TypeError: Cannot read properties of null (reading 'commentsNumber')
    at assertCorrectState (main.2735eaac.js:84829:20)
    at fromInput (main.2735eaac.js:84819:3)
    at CustomFieldInput (main.2735eaac.js:84689:95)
// (...) obfuscated functions

The attribute schema is as follows:

  "attributes": {
    "comments": {
      "type": "customField",
      "customField": "plugin::comments.comments"
    }
  }

Is there anything I might have missed in my configuration that would cause such an error?

mjadczuk commented 1 year ago

I can confirm that the plugin works with Strapi 4.4.7, but fails with the error that I've posted on Strapi 4.5.3.

cyp3rius commented 1 year ago

Investigation in progress

cyp3rius commented 1 year ago

@mjadczuk fixed in v2.2.3