Lakshan-Madushanka / laravel-comments

Integrate seamless commenting functionality into your Laravel project
https://lakm.gitbook.io/commenter/
MIT License
235 stars 6 forks source link

Undefined column "reactions_count" when creating comment #51

Open rahmap opened 1 day ago

rahmap commented 1 day ago

Bug type

Behaviour

Commenter Version

2.0

Description

![Uploading image.png…]()

Here the query :

select "comments"., (select count() from "reactions" where "comments"."id" = "reactions"."comment_id" and "type" = like) as "likes_count", (select count() from "reactions" where "comments"."id" = "reactions"."comment_id" and "type" = dislike) as "dislikes_count", (select count() from "reactions" where "comments"."id" = "reactions"."comment_id" and "type" = happy) as "happies_count", (select count() from "reactions" where "comments"."id" = "reactions"."comment_id" and "type" = love) as "love_count", (select count() from "reactions" where "comments"."id" = "reactions"."comment_id" and "type" = sad) as "sads_count", (select count() from "comments" as "laravel_reserved_0" where "comments"."id" = "laravel_reserved_0"."reply_id") as "replies_count", (select count() from "reactions" where "comments"."id" = "reactions"."comment_id") as "reactions_count", (select count() from "reactions" inner join "comments" as "laravel_reserved_1" on "laravel_reserved_1"."id" = "reactions"."comment_id" where "comments"."id" = "laravel_reserved_1"."reply_id") as "reply_reactions_count", (select count() from "reactions" inner join "comments" as "laravel_reserved_2" on "laravel_reserved_2"."id" = "reactions"."comment_id" where "comments"."id" = "laravel_reserved_2"."reply_id" and "type" = dislike) as "reply_reactions_dislikes_count" from "comments" where "comments"."commentable_type" = App\Models\Utility\Documentation\Documentation and "comments"."commentable_id" = 1 and "comments"."commentable_id" is not null order by reactions_count - (dislikes_count 2) + (replies_count 2) + reply_reactions_count - (reply_reactions_dislikes_count * 2) desc limit 15 offset 0

Steps To Reproduce

  1. Go to comment section
  2. type new comment on section comment
  3. submit comment
  4. wait loading, then error shown

Reproduce URL

Database

PgSql

No response

rahmap commented 1 day ago

image