User Badges Fix

A Flarum extension. Fix notifications error caused by user badges because of no badges included in some pages without UserSerializer.

TypeError: subject.badge().icon is not a function #32
Reproduction: Open any page that has not loaded the current user's badge data, click the notification button to generate an error.
Reason: User badges were loaded through user. userBadges. badge, causing notifications to fail to retrieve badge information and report an error.
It seems that User badges have not been updated for two years, and issues/pr have not been handled,
In order to fix promptly and avoid forking, I opened this separate extension to repair.
Installation
Install with composer:
composer require foskym/flarum-user-badges-fix:"*"
Updating
composer update foskym/flarum-user-badges-fix:"*"
php flarum migrate
php flarum cache:clear
Links