From 644de1c4e7616b13ea203f72b661ecb17ffa84a0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Aug 2018 16:30:09 -0300 Subject: [PATCH] Bug 21222: (bug 20226 follow-up) Fix patron creation Since bug 20226 you cannot longer creation a patron, memberentry.pl will explode with Template process failed: undef error - DBIC result _type isn't of the _type Category at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc line 22. The problem is that "patron" is actually defined and the test in str/members-menu.inc does not work as expected. It comes from commit 7b1d08df0f4f69c52826c80a13158245287f4c00 Bug 19936: Replace Generate_Userid - Update the occurrences where I needed $patron to be defined in order to use Koha::Patron->generate_userid on an blessed object. But this was actually wrong, as it could have side-effects. Test plan: Create a new patron Edit it Retest bug 19936 and make sure the userid is generated correctly in the different situations Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../prog/en/modules/members/memberentrygen.tt | 20 +++++++++++++++--- members/memberentry.pl | 21 ++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 0b77bfcd91..695b1e29a5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -4,7 +4,17 @@ [% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF categoryname %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %]) +Koha › Patrons › + [% UNLESS blocking_error %] + [% IF ( opadd ) %]Add + [% ELSIF ( opduplicate ) %]Duplicate + [% ELSE %] Modify + [% END %] patron + [% IF (firstname) %][% firstname %] [% END %] + [% IF (surname) %][% surname %] [% END %] + ([%IF categoryname %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %]) + [% END %] + [% INCLUDE 'doc-head-close.inc' %] @@ -12,15 +22,19 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -