Skip to content

[2.x] chore(flags): dispatch model events when flags are deleted#4818

Open
DavideIadeluca wants to merge 3 commits into
flarum:2.xfrom
glowingblue:di/flags-change
Open

[2.x] chore(flags): dispatch model events when flags are deleted#4818
DavideIadeluca wants to merge 3 commits into
flarum:2.xfrom
glowingblue:di/flags-change

Conversation

@DavideIadeluca

@DavideIadeluca DavideIadeluca commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #0000
No eloquent model events being dispatched when a flag gets deleted

Changes proposed in this pull request:

  • Change how flags are deleted. With the new approach model events are fired after each delete, allowing Observers to hook into this.
  • This in turn also allows the Audit Integration to loose some complexity with the macro

Reviewers should focus on:

Screenshot

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.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)

@DavideIadeluca
DavideIadeluca marked this pull request as ready for review July 16, 2026 17:35
@DavideIadeluca
DavideIadeluca requested a review from a team as a code owner July 16, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant