Bug 13655

Summary: Can't save organisation type patron without entering userid/password
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: major    
Priority: P5 - low CC: bob-ewart, fridolin.somers, gmcharlt, indradg, jonathan.druart, josef.moravec, kyle.m.hall, martin.renvoize, nick, veron
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19908
Whiteboard:
Change sponsored?: --- Patch complexity: Trivial patch
Bot Control: --- When did the bot last check this:
Who signed the patch off: Text to go in the release notes:
Bug Depends on: 19936    
Bug Blocks:    
Attachments: Bug 13655: Allow creation of organisations without entering userid
Bug 13655: Allow creation of organisations without entering userid
Screencast
Bug 13655: Same fix for partial edit
Bug 13655: Allow creation of organisations without entering userid
Bug 13655: Same fix for partial edit
Bug 13655: Allow creation of organisations without entering userid
Bug 13655: Same fix for partial edit

Description Katrin Fischer 2015-02-02 16:45:00 UTC
Ran into another problem here - if you leave the password/userid empty on creating a new organisation type patron, you get an error message. Koha should be able to create a userid for organisation patrons (no firstname) too or leave it empty (ILL libraries etc. don't need a login).
Comment 1 Katrin Fischer 2018-02-25 22:21:10 UTC
Koha should automatically generate a valid username on saving the patron. For organisations this currently fails and you are forced to manually enter a username.

To test:
- Add a new patron of a patron category marked as 'organisation'.
- Enter a name and cardnumber for the patron and try to save.
- You will see an error message:


The following fields are wrong. Please fix them.

    Username/password already exists.

- Verify you can only save the patron after manually entering a userid.
Comment 2 Josef Moravec 2018-02-26 07:12:26 UTC
I realize, it really confuses librarians, raising importance.
Comment 3 Katrin Fischer 2018-04-12 12:25:31 UTC
Still present when testing with bug 19936. Solution should build on the new code.
Comment 4 Jonathan Druart 2018-04-12 16:43:28 UTC
Created attachment 74114 [details] [review]
Bug 13655: Allow creation of organisations without entering userid

See comment 1 of the bug report for defails of the issue.

Test plan:
Good luck (you will need to test all combinations (category type eq and
ne 'I'), then quick edition and partial edit)
Comment 5 Jonathan Druart 2018-04-12 16:44:08 UTC
Let's try this?
Comment 6 Katrin Fischer 2018-04-15 09:41:04 UTC
Created attachment 74192 [details] [review]
Bug 13655: Allow creation of organisations without entering userid

See comment 1 of the bug report for defails of the issue.

Test plan:
Good luck (you will need to test all combinations (category type eq and
ne 'I'), then quick edition and partial edit)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2018-04-15 09:42:09 UTC
Appears to works well, marking signed off.
Comment 8 Josef Moravec 2018-04-16 14:06:13 UTC
When partially editing an organization patron and clean field username, it is expected the username will be regenerated (as when do full edit, or full and partial edit of normal patron), but the username is leaved unchanged!
Comment 9 Katrin Fischer 2018-04-16 21:28:14 UTC
I can't reproduce this problem, can you double check?

This is what I tried:

1) patch applied, restart all, etc.
2) find a patron with a organisation type category
3) use edit link below 'library use'
4) empty username
5) save
6) username is generated
Comment 10 Jonathan Druart 2018-06-20 16:52:41 UTC
ping Josef?
Comment 11 Josef Moravec 2018-06-20 19:40:47 UTC
Created attachment 76219 [details]
Screencast

Sorry, for delay. This is what I mean
Comment 12 Jonathan Druart 2018-06-21 15:29:53 UTC
Created attachment 76239 [details] [review]
Bug 13655: Same fix for partial edit

Test plan:
- Create an organisation with surname='xxx'
userid will be autogenerated with 'xxx''
- Edit the surname with 'yyy'
userid will be unchanged, 'xxx'
- Parial edit and blank userid
userid will be autogenerated with 'yyy'
Comment 13 Jonathan Druart 2018-06-21 15:31:03 UTC
Indeed, thanks Josef!
Comment 14 Katrin Fischer 2018-06-22 06:17:58 UTC
Created attachment 76250 [details] [review]
Bug 13655: Allow creation of organisations without entering userid

See comment 1 of the bug report for defails of the issue.

Test plan:
Good luck (you will need to test all combinations (category type eq and
ne 'I'), then quick edition and partial edit)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2018-06-22 06:18:02 UTC
Created attachment 76251 [details] [review]
Bug 13655: Same fix for partial edit

Test plan:
- Create an organisation with surname='xxx'
userid will be autogenerated with 'xxx''
- Edit the surname with 'yyy'
userid will be unchanged, 'xxx'
- Parial edit and blank userid
userid will be autogenerated with 'yyy'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2018-06-22 06:18:26 UTC
Retested! Josef, can you take another look for QA?
Comment 17 Josef Moravec 2018-06-22 07:05:25 UTC
Created attachment 76253 [details] [review]
Bug 13655: Allow creation of organisations without entering userid

See comment 1 of the bug report for defails of the issue.

Test plan:
Good luck (you will need to test all combinations (category type eq and
ne 'I'), then quick edition and partial edit)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 18 Josef Moravec 2018-06-22 07:05:29 UTC
Created attachment 76254 [details] [review]
Bug 13655: Same fix for partial edit

Test plan:
- Create an organisation with surname='xxx'
userid will be autogenerated with 'xxx''
- Edit the surname with 'yyy'
userid will be unchanged, 'xxx'
- Parial edit and blank userid
userid will be autogenerated with 'yyy'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 19 Nick Clemens 2018-06-22 13:50:17 UTC
Awesome work all!

Pushed to master for 18.11.x
Comment 20 Martin Renvoize 2018-06-25 17:27:11 UTC
Pushed to 18.05.x for 18.05.02
Comment 21 Fridolin SOMERS 2018-06-28 07:04:53 UTC
Depends on Bug 19936 not in 17.11.x