Bug 32445: (follow-up) Fix availability display on opac-course-details
[srvgit] / opac / opac-memberentry.pl
index 427c99d..0115d78 100755 (executable)
@@ -41,8 +41,6 @@ use Koha::Libraries;
 use Koha::Patron::Attribute::Types;
 use Koha::Patron::Attributes;
 use Koha::Patron::Images;
-use Koha::Patron::Modification;
-use Koha::Patron::Modifications;
 use Koha::Patron::Categories;
 use Koha::Token;
 use Koha::AuthorisedValues;
@@ -275,6 +273,13 @@ if ( $action eq 'create' ) {
                         };
                     }
                 }
+
+                # Notify library of new patron registration
+                my $notify_library = C4::Context->preference('EmailPatronRegistrations');
+                if ($notify_library) {
+                    $patron->notify_library_of_registration($notify_library);
+                }
+
             } else {
                 # FIXME Handle possible errors here
             }
@@ -725,6 +730,7 @@ sub ParsePatronAttributes {
 
     my $delete_candidates = {};
 
+    my $scrubber = C4::Scrubber->new();
     while ( my ( $code, $value ) = $ea->() ) {
         if ( any { $_ eq $code } @editable_attribute_types ) {
             # It is an editable attribute
@@ -734,7 +740,7 @@ sub ParsePatronAttributes {
             }
             else {
                 # we've got a value
-                push @attributes, { code => $code, attribute => $value };
+                push @attributes, { code => $code, attribute => $scrubber->scrub( $value ) };
 
                 # 'code' is no longer a delete candidate
                 delete $delete_candidates->{$code}