SEMOSS / Semoss

Apache License 2.0
28 stars 5 forks source link

Bug fix for updating email for Edit User #171

Closed mattfreshwaters closed 4 weeks ago

mattfreshwaters commented 1 month ago

SemossWeb will send in a 'newEmail' field - originally this code looks unfinished as it was never added to the prepared statment, despite being added to the columns & value lists provided to the editUser PreparedStatement (lines 739-748)

This is in relation to semoss-ui ticket and pull request

themaherkhalil commented 1 month ago

I think the email field needs to come after the id field. Can you confirm?

mattfreshwaters commented 4 weeks ago

@themaherkhalil you mean the newEmail field should be after the newId? this is what one of the updates looks like: UPDATE SMSS_USER SET EMAIL = ?, NAME = ?, TYPE = ?, ADMIN = ?, PUBLISHER = ?, EXPORTER = ?, PHONE = ? WHERE ID = ?

themaherkhalil commented 4 weeks ago

But what if you try editing the id to a new value for the user? I think it will add ID before EMAIL

mattfreshwaters commented 4 weeks ago

@themaherkhalil I just realized the ui is sending "id" and it looks like the backend is expecting "newId" for when that field changes - so that looks like a frontend bug, let me see if I can get that newId sent over to verify

mattfreshwaters commented 4 weeks ago

But what if you try editing the id to a new value for the user? I think it will add ID before EMAIL

Double checked you are correct the id field is added before email if a newId field is sent in