From f2b2a26cafe9d568ef724833678fe9a202309ab7 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sat, 13 Mar 2021 17:18:55 -0500 Subject: [PATCH] Use Settings extender serializeToForum properly now that it supports defaults. --- extensions/nicknames/extend.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/nicknames/extend.php b/extensions/nicknames/extend.php index cbe34c408..663885401 100644 --- a/extensions/nicknames/extend.php +++ b/extensions/nicknames/extend.php @@ -41,10 +41,8 @@ return [ return $actor->id === $user->id && $serializer->getActor()->can('editOwnNickname', $user); }), - (new Extend\ApiSerializer(ForumSerializer::class)) - ->attribute('displayNameDriver', function ($serializer, $user) { - return app(SettingsRepositoryInterface::class)->get('display_name_driver', 'username'); - }), + (new Extend\Settings()) + ->serializeToForum('displayNameDriver', 'display_name_driver', null, 'username'), (new Extend\Validator(UserValidator::class)) ->configure(AddNicknameValidation::class),