We have moved to GitHub Issues
Created by Claus Jensen 24 Oct 2017, 22:20:33 Updated by Claus Jensen 08 Nov 2017, 11:08:49
Subtask of: U4-9609
If you have a member saved with a trailing space in login - it will cause errors when trying to resave this member. However seems like we're checking for this somewhere in the validation logic, since when the member is already saved this way - we don't allow a resave unless you ''change'' the login to something else (removing the trailing whitespace is not enough and won't allow a resave since it believes the login is already in use)
It seems that the Login textbox has ng-trim set to false which is why it allows trailing spaces.
My fix is to just trim the input and that will pretty much fix the issue. Another way I could have done it was to alter the textbox and set ng-trim to true, but I am pretty sure that would cause some problems in other places.
This fix should also be done on the server side which is the safest place to put the fix
Done, server side trimming added. [Commit|https://github.com/umbraco/Umbraco-CMS/pull/2277/commits/8676a99b3ae5cb87c1115ce2f4c846268800aadd]
@robertcopilau Code looks good. I wonder though, why this isn't a problem on the email field too. Could you spend a few minutes checking where we do the sanitation/trimming of the email field - and ensure that whatever we do also covers when an email is being saved with excessive spaces, through the services/API.
Email gets trimmed when saved in the UI, but I can't tell from that whether saving via the services will also trim it.
Sure, will take a look.
Moved the trimming to the service level for both email and username. [Commit |https://github.com/umbraco/Umbraco-CMS/pull/2277/commits/73b2d31298f496c6381d674de591d31a2ed5b96f]
Thanks :) changes look good .. I haven't tested yet, but can be merged when someone has done a few tests and confirmed that it works.
Backwards Compatible: True
Affected versions: 7.7.3, 7.6.11
Due in version: 7.7.5
Sprint: Sprint 71
Story Points: 0.5