Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when permanently deleting a post #31

Closed
LuckVintage opened this issue Feb 4, 2021 · 2 comments
Closed

Error when permanently deleting a post #31

LuckVintage opened this issue Feb 4, 2021 · 2 comments

Comments

@LuckVintage
Copy link

Hello there,

As long as I can remember I have always had a little pop-up error message (below) when attempting to permanently delete a post. The post appears to delete perfectly fine, but an error message is received.

raw

Today I installed and set-up Sentry using the fof/Sentry extension and a new issue is automatically created in Sentry whenever I try to delete a post forever:

Symfony\Component\Debug\Exception\FatalThrowableError
Argument 1 passed to FoF\Gamification\Listeners\RemoveVoteHandler::handle() must be an instance of Flarum\Post\Event\Deleting, instance of Flarum\Post\Event\Deleted given, called in /var/www/html/flarum/vendor/illuminate/events/Dispatcher.php on line 389

I created a support post on the Flarum forum about this, and was advised to report this as an issue on your Github. (https://discuss.flarum.org/d/26138-error-when-permanently-deleting-a-post)

Many Thanks.

@clarkwinkelmann
Copy link
Member

Definitely something we want to take a look at soon. It shouldn't be too difficult to fix too.

This line uses Deleted event

->listen(Deleted::class, Listeners\RemoveVoteHandler::class)

While this line uses Deleting

public function handle(Deleting $event)

I think Deleted is the one that makes the most sense, since another extension could still cancel the deletion in Deleting, while Deleted happens after it was already deleted for sure.

@clarkwinkelmann clarkwinkelmann changed the title Error when permanently deleting a post (potential bug with gamification extension) Error when permanently deleting a post Mar 12, 2021
@Ralkage
Copy link
Contributor

Ralkage commented Mar 12, 2021

Pushed the fix as @clarkwinkelmann pointed out ;) I'll tag a patch release shortly.

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

No branches or pull requests

3 participants