Task::addComment returns the wrong value

Created on 17 June 2025, 16 days ago

Problem/Motivation

The Task::addComment method's documentation claims to return a reference to the comment entity that was added, but instead returns the integer return value of the comment's save call.

Steps to reproduce

$task = \Drupal\minikanban\Entity\Task::create();
$task->save();

// $comment should be a Comment entity, it's instead an integer.
$comment = $task->addComment('test', 1);

Proposed resolution

Change the logic in the method to return the comment entity.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom jeremyskinner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024