[Bug] can't edit username/email #138

Closed
opened 2026-02-04 17:27:06 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @strinque on GitHub (Oct 12, 2021).

Description
Once logged on planka, it's impossible to update the username or email.
However it's still possible to update the password.

Reproduction
Login => User => Settings => Edit Username
Login => User => Settings => Edit Email
Any modification will show the "Unknown error, try again later" error message.

Logs with pm2

type=error message=error: Sending 500 ("Server Error") response: 
type=error message= TypeError: sails.helpers.users.update is not a function
type=error message=    at Object.fn (/server/api/controllers/users/update-email.js:72:8)
type=error message=    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Possible Fix?
There might be an issue with the commit: "b39119ace47b41666f4da230724a7712796b2a47" during the refactoring.

The function is correct for update-password.js:

# server/api/controllers/users/update-password.js
user = await sails.helpers.users.updateOne(user, values, this.req);

Not for update-email.js and update-username.js:

# server/api/controllers/users/update-email.js
# server/api/controllers/users/update-username.js
    user = await sails.helpers.users
      .update(user, values, this.req)

Fix: replace update(user, values, this.req) by updateOne(user, values, this.req) in those files.

It has fixed the issue for me but I'm not sure about the fix so I didn't made a pull-request.
Thanks anyway for this awesome project!

Originally created by @strinque on GitHub (Oct 12, 2021). **Description** Once logged on planka, it's impossible to update the username or email. However it's still possible to update the password. **Reproduction** Login => User => Settings => Edit Username Login => User => Settings => Edit Email Any modification will show the "Unknown error, try again later" error message. **Logs with pm2** ``` type=error message=error: Sending 500 ("Server Error") response: type=error message= TypeError: sails.helpers.users.update is not a function type=error message= at Object.fn (/server/api/controllers/users/update-email.js:72:8) type=error message= at processTicksAndRejections (node:internal/process/task_queues:96:5) ``` **Possible Fix?** There might be an issue with the commit: "b39119ace47b41666f4da230724a7712796b2a47" during the refactoring. The function is correct for update-password.js: ``` # server/api/controllers/users/update-password.js user = await sails.helpers.users.updateOne(user, values, this.req); ``` Not for update-email.js and update-username.js: ``` # server/api/controllers/users/update-email.js # server/api/controllers/users/update-username.js user = await sails.helpers.users .update(user, values, this.req) ``` Fix: replace `update(user, values, this.req)` by `updateOne(user, values, this.req)` in those files. It has fixed the issue for me but I'm not sure about the fix so I didn't made a pull-request. Thanks anyway for this awesome project!
OVERLORD added the bug label 2026-02-04 17:27:06 +03:00
Author
Owner

@meltyshev commented on GitHub (Oct 20, 2021):

Thanks for reporting this. Fixed by https://github.com/plankanban/planka/pull/168.

@meltyshev commented on GitHub (Oct 20, 2021): Thanks for reporting this. Fixed by https://github.com/plankanban/planka/pull/168.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#138