Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't update client because "Client Id _clientId_ already exists" #227

Closed
pavvlik777 opened this issue Jul 25, 2024 · 14 comments
Closed

Can't update client because "Client Id _clientId_ already exists" #227

pavvlik777 opened this issue Jul 25, 2024 · 14 comments
Assignees

Comments

@pavvlik777
Copy link
Contributor

Describe the bug

When clicking 'Save Client' button client is not updated and 'Client Id clientId already exists' error received

To Reproduce

  1. Click 'Edit' any existing client
  2. Click 'Save Client'

Result

Error received
image

Expected result

Client is successfully updated

Notes

It appears that issue is caused by missing <input type="hidden" asp-for="Id" /> tag on client configuration page. Because of that model.Id is 0 on POST request and backend trying to create client rather than update existing. Issue wasn't happening on 1.1.0 version, because there was tag on basics tab.

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

Hi @pavvlik777 - thanks for reporting your issue, I will check it!

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

I have checked it and it works correctly for me. Id is not stored in hidden field but it is correctly populated from URL.
Are you sure that you do not have some client twice?
Thanks.

@pavvlik777
Copy link
Contributor Author

Hi, thanks for response.

I double-checked client id and didn't find any duplicates in db.
image
I was able to reproduce same issue by creating new client and clicking 'save client' immediately after that. I was redirected to creation page and id disappeared from URL.
image

Also I noticed that adding clientId manually to form URL like this
image
fixes issue.

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

What version of Admin UI do you use?

@pavvlik777
Copy link
Contributor Author

2.3.0

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

Let me check it again.

Adding of <input type="hidden" asp-for="Id" /> resolved this issue?

@pavvlik777
Copy link
Contributor Author

Yes

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

OK, I will merge your PR and release it in release 2.4.0.
Thank you.

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

Can you also check console in your browser in case that you have some JS errors?

@pavvlik777
Copy link
Contributor Author

No js errors
image

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

Why do you have ?area=AdminUI in your links?

@pavvlik777
Copy link
Contributor Author

Looks like it's added automatically on all links, but there were no specific adjustments to achieve this from my side.
image

@skoruba
Copy link
Owner

skoruba commented Jul 26, 2024

Ok, interesting, I have never seen it before. 😁

@skoruba skoruba mentioned this issue Sep 28, 2024
6 tasks
@skoruba
Copy link
Owner

skoruba commented Sep 29, 2024

Released in 2.4.0.
Thanks!

@skoruba skoruba closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants