#5327 Cannot change primary e-mail address
Closed: Fixed a year ago by ngompa. Opened 2 years ago by gui1ty.

I have three e-mail addresses registered on pagure.io. When I try to change the primary address and click on the star next to e-mail three it changes to e-mail two. Going back and clicking on the star next to e-mail 3 again changes it back to e-mail one.

I have screenshots, but I'm unable to upload/attach them to the issue. :cry:


Any update on the issue? I'd really like to change my primary e-mail address.

I'm not sure what's going on, but I can reproduce.

Nudge, nudge. Issue is stil present.

Metadata Update from @ngompa:
- Issue assigned to wombelix
- Issue tagged with: UI, bug

a year ago

The issue is caused by the frontend code because all email addresses get the same form id assigned, which ends up that just the first one that's found will be submitted, this is either the second address, if the first is default, or the first address if the second is default.

In each link:data-form-id="default_mail"
In each form:id="default_mail"

I'm looking for a good way to generate a random number in jinja and append it, as soon each email address has it's unqiue from-id, it's working without issues, I'm going to create a PR soon.

Thanks a lot for fixing this @wombelix. @ngompa, I guess the fix still needs to be applied to stable? Currently the behavior unchanged.

If you urgently need to change your mail address @gui1ty, you can do it with a workaround by using the developer tools in your browser. The bug is pure frontend, so adjusting the HTML Code and then submitting will send the right data to pagure and perform the change. It's the same way I troubleshooted the issue and tested my fix before actually implementing it.

I attached a Screenshot, every additional, non default mail address, is inside a separate <div>, which contains a <form> with the id default_mail, followed by a <a> link with the similar value in data-form-id. As soon every mail address has a unique set of IDs, you can click on the star icon and successfully change the address.

So in my example I have 3 mails, one default, two additional. To make it unique I just had to change the two fields on one of the additional addresses, I marked the code block that belongs to the address yellow, my two changes in red. This make the form id's unique and I can change my default address to the third in the list.

If you have 4, 5 or 6 additional mail addresses, you need to change the ID's on all of them before clicking on the star icon next to the address you want to make default.

It's a little hacky and sounds probably very complicated, but that way you could already change your address right away before the code of the pagure.io instance get updated.

pagure_change_primary_mail_workaround_developer_tools.png

Thanks for the detailed explanation @wombelix. I might give it a try. No real urgency, though.

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #5364 Merged a year ago