Bug 13655: Same fix for partial edit
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Jun 2018 15:28:18 +0000 (12:28 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 22 Jun 2018 13:12:54 +0000 (13:12 +0000)
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>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

members/memberentry.pl

index 6ed356c..5dc318c 100755 (executable)
@@ -283,7 +283,7 @@ if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_Borrow
         $patron->surname($newdata{surname});
         $newdata{'userid'} = $patron->generate_userid;
     }
-    elsif ( ( defined $data{'firstname'} ) && ( defined $data{'surname'} ) ) {
+    elsif ( ( defined $data{'firstname'} || $category_type eq 'I' ) && ( defined $data{'surname'} ) ) {
         # Partial page edit (access through "Details"/"Library details" tab), firstname and surname input zones are not used
         # Still, if the userid field is erased, we can create a new userid with available firstname and surname
         # FIXME clean thiscode newdata vs data is very confusing