Leantime / leantime

Leantime is a goals focused project management system for non-project managers. Building with ADHD, Autism, and dyslexia in mind.
https://leantime.io
GNU Affero General Public License v3.0
4.41k stars 578 forks source link

[BUG] API Add comment exception #2164

Open JeromePTI opened 8 months ago

JeromePTI commented 8 months ago

When calling the addComment API, it throws an exception :

ErrorException: Warning: Attempt to read property "type" on string

The bug is in : app/Domain/Comments/Services/Comments.php

https://github.com/Leantime/leantime/blob/5c4956c9e67aa2836aac1770edace33d04e6aca0/app/Domain/Comments/Services/Comments.php#L84C195-L84C197

$entity is a string, not an object, while called by API

marcelfolaron commented 8 months ago

When creating ticket comments the service method expects the entity to be a ticket object. Can you pass in the ticket as json object?

JeromePTI commented 8 months ago

Thanks for your reply

Last week I tried to pass in the ticket as json object but it doesn't work, I got the same exception