]> git.koha-community.org Git - koha.git/commit
Bug 1861: There is a problem introduced with an earlier patch, on this patchset
authorChris Cormack <chrisc@catalyst.net.nz>
Tue, 30 Dec 2014 02:37:39 +0000 (15:37 +1300)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 30 Dec 2014 18:56:06 +0000 (07:56 +1300)
commit2190b9b67ccde78c70e7c4f8956ddb004fc4d6a5
tree019be81a306ae7b56ab3eb01d3807e8481730e01
parent33125c05ac12db65fd03a70283c946daaf22a581
Bug 1861: There is a problem introduced with an earlier patch, on this patchset

-    $data{'userid'} = Generate_Userid($data{'borrowernumber'},
$data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
+    $data{'userid'} = Generate_Userid( $data{'borrowernumber'},
$data{'firstname'}, $data{'surname'} )
+      if ( $data{'userid'} eq '' || Check_Userid( $data{'userid'} ) );

Check_Userid returns 1 if it is unique.  So this means unique userids
will always be discarded and new ones created.

This is why all the tests depending on a userid are now failing

To test

1/ run perl t/db_dependent/Serials_2.t
2/ Notice lots of tests fail
3/ OR Add a borrower with a userid set, notice the userid is ignored
and one is generated instead
4/ Apply patch
5/ Add a new borrower, notice the userid sticks (if it is unique)
6/ Run perl t/db_dependent/Serials_2.t notice tests pass
7/ Run perl t/db_dependent/Members.t notice tests still pass

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
(cherry picked from commit f326488f9afb9752b93d07858b6ac9d525838ff0)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Members.pm