Skip to content

fix(likes): don't let a liked post with no text break the notification list - #5219

Open
imorland wants to merge 1 commit into
2.xfrom
im/likes-liked-notification-excerpt
Open

imorland wants to merge 1 commit into
2.xfrom
im/likes-liked-notification-excerpt

Conversation

@imorland

Copy link
Copy Markdown
Member

Refs #4108

Changes proposed in this pull request:
The API accepts a like on any post type, but only comment posts have text. When someone likes, say, a "discussion renamed" post, the author's liked notification throws while building its excerpt, and the author's whole notification list renders nothing, other notifications included. The excerpt now falls back to an empty string, as the mentions notification already does. #4108 stays open for the extensible "can this post type notify" design.

Reviewers should focus on:

Screenshot
N/A

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Frontend changes: tests are green (run yarn test in js/).
  • Frontend changes: tests have been added, or are not appropriate here.
  • Backend changes: tests are green (run composer test). (No backend changes.)
  • Backend changes: tests have been added, or are not appropriate here. (No backend changes.)
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (No database changes.)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

…n list

The API accepts a like on any post type, but only comments have text. The notification's excerpt then threw, and the whole notification list rendered nothing.
@imorland
imorland requested a review from a team as a code owner October 16, 2026 17:45
@imorland imorland added this to the 2.0.2 milestone Oct 16, 2026
@imorland imorland modified the milestones: 2.0.2, 2.1 Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant