gamification
gamification copied to clipboard
Fix json encode null
Fix json encode null in php8.3
Fixes #0000
Changes proposed in this pull request:
Reviewers should focus on:
Screenshot
Confirmed
- [ ] Frontend changes: tested on a local Flarum installation.
- [ ] Backend changes: tests are green (run
composer test).
Required changes:
- [ ] Related Flarum core extension PR's: (Omit this section if irrelevant)
@DavideIadeluca if you want to do an optimization, although just a slight one, stop early instead of accessing the settings repository first (which you then don't need for an admin):
if ($this->user->isAdmin()) return;
return json_decode(
$settings->get('fof-gamification.autoAssignGroups', '[]'),
true
);
@DavideIadeluca if you want to do an optimization, although just a slight one, stop early instead of accessing the settings repository first (which you then don't need for an admin):
if ($this->user->isAdmin()) return; return json_decode( $settings->get('fof-gamification.autoAssignGroups', '[]'), true );
Yeah right, makes sense. @datlechin Can you please use the suggestion of @luceos instead? 🙏