ChangeName Error for admin with SSO

AI-generated summary

In a Bug report titled “ChangeName Error for admin with SSO”, ColdSun encountered a TypeError when attempting to edit an admin username via the preferences page. The error, this.get(...).changeUsername is not a function, occurred despite SSO being enabled but unused for that specific user. eviltrout initially inquired if the account was deleted, but ColdSun confirmed the user was intact. eviltrout then hypothesized that pressing Enter instead of clicking the submit button might be the cause. This was confirmed, and eviltrout fixed the issue by correcting the form submission logic when the Enter key is pressed, linking to the commit 1e36400.

When attempting to edit the original admin account’s username (SSO is enabled but not used for this user), the following error was created

Uncaught TypeError: this.get(...).changeUsername is not a function
Url: /discourse/views/preferences-username
Line: 18
Column: 43
Window Location: http://forums.ego.ninja/users/coldsun/preferences/username

Is the user deleted or anything unusual like that? I just tried to change my name locally and it worked fine.

Nope. The user hasn’t been deleted or modified in any way.

Here’s the env log:

TypeError: this.get(...).changeUsername is not a function
at __exports__.default.Ember.View.extend.keyDown (/discourse/views/preferences-username:18:43)
at EmberObject.extend.trigger (/production/ember:39524:25)
at apply (/production/ember:19209:27)
at superWrapper [as trigger] (/production/ember:18780:15)
at Object.merge.handleEvent (/production/ember:39739:23)
at CoreView.extend.handleEvent (/production/ember:41827:34)
at Object.Backburner.run (/production/ember:195:27)
at Object.Backburner.join (/production/ember:218:27)
at Function.run.join (/production/ember:17510:30)
at __exports__.default.EmberObject.extend._bubbleEvent (/production/ember:37392:20)

Are you hitting enter rather than clicking the button? It might be that simple!

Confirmed and fixed. The bug was the enter key to submit the form was broken:

https://github.com/discourse/discourse/commit/1e364000210410beeb9a6f3c78ea70969cae2e99

「いいね!」 2