+ if (Event::handle('StartGroupSaveForm', [$this])) {
+
+ // $nickname will only be set if this changenick value is true.
+ $nickname = null;
+ if (common_config('profile', 'changenick') == true) {
+ try {
+ $nickname = Nickname::normalize($this->trimmed('newnickname'), true);
+ } catch (NicknameTakenException $e) {
+ // Abort only if the nickname is occupied by _another_ group
+ if ($e->profile->id != $this->group->profile_id) {
+ $this->setMessage($e->getMessage(), true);
+ return;
+ }
+ $nickname = Nickname::normalize($this->trimmed('newnickname')); // without in-use check this time
+ } catch (NicknameException $e) {
+ $this->setMessage($e->getMessage(), true);
+ return;
+ }
+ }