mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
The activity feed rendered "edited comment undefined" / "deleted comment undefined" for comment edits and deletions. The template passed the comment's ID into the "%s" of activity-editComment / activity-deleteComment: on older activities the id was absent (literally "undefined"), and a deleted comment's CardComment document is already removed so it cannot be looked up live either. The edit and delete activities now store the comment text (commentText), and a new Activities.commentDisplayText() helper picks the stored text, else the live comment text (edit case), else an empty string — so the feed never renders the word "undefined". The template shows the (sanitized) comment text. The text-selection logic is a Meteor-free helper models/lib/commentActivity.js, unit tested (positive + negative) in tests/commentActivity.test.cjs. Thanks to janchuelo and xet7.