@@ -, +, @@ --------- - configuring Koha to run under https (tweaking apache2 isn't so hard, just tricky) - configuring Koha to run OPAC and Staff with Plak (since code with comments about plak were sliced out) - configuring Koha to use CAS (may be requires for the CAS test) 1) Apply patch 2) Make sure OPACBaseURL is set without the protocol included. 3) back up your DB 4) ./installer/data/mysql/updatedatabase.pl -- It should run without errors. 5) Look up the OPACBaseURL system preference in the staff client -- It should have http:// prepended. 6) Run the mysqlclient from your koha git directory USE koha_library; SELECT content FROM letter WHERE content LIKE "%<>%"; -- There should be no prepended http:// on the <>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. 9) Call up staff client. -- C4/Auth.pm doesn't barf. -- C4/Auth.pm doesn't barf. -> OPAC on it. -- It should be modified to include http:// -- It should save normally -- There should be a "OPAC view" link which has the correct http:// or https:// in it. USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<>%"; -- Each of the selects should should lines that have <> starting them, but no hard-coded http:// DELETE FROM systempreferences; source installer/data/mysql/sysprefs.sql; SELECT * FROM systempreferences WHERE variable='OPACBaseURL'; -- The explanation should reflect the new explanation. QUIT preferably https. -- Using https requires a bunch of apache2 tweaks. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// -- the URL beside 'OPAC View' should have the appropriate http:// or https:// -- the Share links should have the appropriate protocol on the OPACBaseURL. -- the Share links should have the appropriate protocol on the OPACBaseURL. -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( --- C4/Auth.pm | 7 +---- C4/Auth_with_shibboleth.pm | 16 ++++++++++- C4/Context.pm | 5 ++++ catalogue/detail.pl | 6 ---- .../data/mysql/de-DE/mandatory/sample_notices.sql | 2 +- .../data/mysql/en/mandatory/sample_notices.sql | 2 +- .../data/mysql/es-ES/mandatory/sample_notices.sql | 2 +- .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 2 +- installer/data/mysql/it-IT/necessari/notices.sql | 2 +- .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 2 +- .../data/mysql/pl-PL/mandatory/sample_notices.sql | 2 +- .../data/mysql/ru-RU/mandatory/sample_notices.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- .../data/mysql/uk-UA/mandatory/sample_notices.sql | 2 +- installer/data/mysql/updatedatabase.pl | 24 ++++++++++++++++ .../prog/en/modules/admin/preferences/opac.pref | 4 +-- .../prog/en/modules/catalogue/detail.tt | 4 +-- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 2 +- .../prog/en/xslt/NORMARCslim2intranetDetail.xsl | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 10 +++---- opac/opac-shareshelf.pl | 3 +- t/Auth_with_shibboleth.t | 26 +++++++++++++++-- t/db_dependent/Auth.t | 30 +++++++++++++++++++- t/db_dependent/Auth_with_cas.t | 2 +- t/db_dependent/Context.t | 28 +++++++++++++++++- virtualshelves/sendshelf.pl | 5 ---- 26 files changed, 148 insertions(+), 46 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -383,6 +383,7 @@ sub get_template_and_user { noItemTypeImages => C4::Context->preference("noItemTypeImages"), marcflavour => C4::Context->preference("marcflavour"), persona => C4::Context->preference("persona"), + OPACBaseURL => C4::Context->preference('OPACBaseURL'), ); if ( $in->{'type'} eq "intranet" ) { $template->param( @@ -453,11 +454,6 @@ sub get_template_and_user { $opac_name = C4::Context->userenv->{'branch'}; } - # FIXME Under Plack the CGI->https method always returns 'OFF' ($using_https will be set to 0 in this case) - my $opac_base_url = C4::Context->preference("OPACBaseURL"); #FIXME uses $using_https below as well - if ( !$opac_base_url ) { - $opac_base_url = $ENV{'SERVER_NAME'} . ( $ENV{'SERVER_PORT'} eq ( $using_https ? "443" : "80" ) ? '' : ":$ENV{'SERVER_PORT'}" ); - } $template->param( opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"), AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"), @@ -477,7 +473,6 @@ sub get_template_and_user { OPACUserCSS => "" . C4::Context->preference("OPACUserCSS"), OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"), OpacAuthorities => C4::Context->preference("OpacAuthorities"), - OPACBaseURL => ( $using_https ? "https://" : "http://" ) . $opac_base_url, opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, opac_search_limit => $opac_search_limit, opac_limit_override => $opac_limit_override, --- a/C4/Auth_with_shibboleth.pm +++ a/C4/Auth_with_shibboleth.pm @@ -113,7 +113,21 @@ sub _get_uri { my $protocol = "https://"; - my $return = $protocol . C4::Context->preference('OPACBaseURL'); + my $uri = C4::Context->preference('OPACBaseURL') // ''; + if ($uri eq '') { + $debug and warn 'OPACBaseURL not set!'; + } + if ($uri =~ /(.*):\/\/(.*)/) { + my $oldprotocol = $1; + if ($oldprotocol ne 'https') { + $debug + and warn + 'Shibboleth requires OPACBaseURL to use the https protocol!'; + } + $uri = $2; + } + + my $return = $protocol . $uri; return $return; } --- a/C4/Context.pm +++ a/C4/Context.pm @@ -638,6 +638,11 @@ sub set_preference { $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' ); + # force explicit protocol on OPACBaseURL + if ($var eq 'opacbaseurl' && substr($value,0,4) !~ /http/) { + $value = 'http://' . $value; + } + my $sth = $dbh->prepare( " INSERT INTO systempreferences ( variable, value ) --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -396,12 +396,6 @@ if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->p $template->param( C4::HTML5Media->gethtml5media($record)); } - -# Get OPAC URL -if (C4::Context->preference('OPACBaseURL')){ - $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') ); -} - # Displaying tags my $tag_quantity; --- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql +++ a/installer/data/mysql/de-DE/mandatory/sample_notices.sql @@ -100,7 +100,7 @@ VALUES ( Ihr Bibliothekskonto wurde angelegt. Bitte bestätigen Sie Ihre E-Mail-Adresse indem Sie auf folgenden Link klicken: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> Wenn Sie keine Kontoanmeldung durchgeführt haben, können Sie diese Benachrichtigung ignorieren. Sie wird in Kürze ungültig. --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ a/installer/data/mysql/en/mandatory/sample_notices.sql @@ -113,7 +113,7 @@ VALUES ( Your library account has been created. Please verify your email address by clicking this link to complete the signup process: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' ); --- a/installer/data/mysql/es-ES/mandatory/sample_notices.sql +++ a/installer/data/mysql/es-ES/mandatory/sample_notices.sql @@ -111,7 +111,7 @@ VALUES ( Your library account has been created. Please verify your email address by clicking this link to complete the signup process: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' ); --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -114,7 +114,7 @@ VALUES ( Votre compte de bibliothèque a été créé. Veuillez valider votre adresse email et le processus d''inscription en cliquant sur ce lien: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> Si vous n''êtes pas à l''origine de cette inscription, vous pouvez ignorer ce message.' ); --- a/installer/data/mysql/it-IT/necessari/notices.sql +++ a/installer/data/mysql/it-IT/necessari/notices.sql @@ -113,7 +113,7 @@ VALUES ( Your library account has been created. Please verify your email address by clicking this link to complete the signup process: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' ); --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -134,7 +134,7 @@ VALUES ( D har blitt registrert som bruker av biblioteket. Verifiser epostadressen din ved å klikke på lenka nedenfor: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> Dersom du ikke har bedt om å bli registret som bruker av biblioteket kan du se bort fra denne engangsmeldingen. Forespørselen vil snart gå ut på dato.' ); --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -113,7 +113,7 @@ VALUES ( Your library account has been created. Please verify your email address by clicking this link to complete the signup process: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' ); --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -114,7 +114,7 @@ VALUES ( Your library account has been created. Please verify your email address by clicking this link to complete the signup process: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' ); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -240,7 +240,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACAllowUserToChooseBranch','1','1','Allow the user to choose the branch they want to pickup their hold from','YesNo'), ('OPACAmazonCoverImages','0','','Display cover images on OPAC from Amazon Web Services','YesNo'), ('OpacAuthorities','1',NULL,'If ON, enables the search authorities link on OPAC','YesNo'), -('OPACBaseURL',NULL,NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.','Free'), +('OPACBaseURL',NULL,NULL,'Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com, including the protocol (http:// or https://). Otherwise, the http:// will be added automatically by Koha upon saving.','Free'), ('opacbookbag','1','','If ON, enables display of Cart feature','YesNo'), ('OpacBrowser','0',NULL,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)','YesNo'), ('OpacBrowseResults','1',NULL,'Disable/enable browsing and paging search results from the OPAC detail page.','YesNo'), --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -113,7 +113,7 @@ VALUES ( Your library account has been created. Please verify your email address by clicking this link to complete the signup process: -http://<>/cgi-bin/koha/opac-registration-verify.pl?token=<> +<>/cgi-bin/koha/opac-registration-verify.pl?token=<> If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' ); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -9759,6 +9759,30 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = '3.19.00.XXX'; +if ( CheckVersion($DBversion) ) { + my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); + if (defined($OPACBaseURL) && substr($OPACBaseURL,0,4) ne "http") { + my $explanation = q{Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com, including the protocol (http:// or https://). Otherwise, the http:// will be added automatically by Koha upon saving.}; + $OPACBaseURL = 'http://' . $OPACBaseURL; + my $sth_OPACBaseURL = $dbh->prepare( q{ + UPDATE systempreferences SET value=?,explanation=? + WHERE variable='OPACBaseURL'; } ); + $sth_OPACBaseURL->execute($OPACBaseURL,$explanation); + } + if (defined($OPACBaseURL)) { + $dbh->do( q{ UPDATE letter + SET content=replace(content, + 'http://<>', + '<>') + WHERE content LIKE "%http://<>%"; } ); + } + + print "Upgrade to $DBversion done (Bug 5010: Fix OPACBaseURL to include protocol)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -13,10 +13,10 @@ OPAC: prog: prog - theme as the fallback theme on the OPAC. - - - "The OPAC is located at http://" + - "The OPAC is located at " - pref: OPACBaseURL class: url - - . Do not include a trailing slash in the URL. (This must be filled in correctly for RSS, unAPI, and search plugins to work.) + - . This should be a complete URL, starting with http:// or https://. Do not include a trailing slash in the URL. (This must be filled in correctly for RSS, unAPI, and search plugins to work.) - - Show - pref: LibraryName --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -425,9 +425,9 @@ function verify_images() { [% END %] - [% IF ( OpacUrl ) %] + [% IF ( OPACBaseURL ) %]
  • OPAC view: - Open in new window + Open in new window
  • [% END %]
  • --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -875,7 +875,7 @@ OPAC view: - http:///cgi-bin/koha/opac-detail.pl?biblionumber=_blankOpen in new window. + /cgi-bin/koha/opac-detail.pl?biblionumber=_blankOpen in new window. --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl +++ a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl @@ -588,7 +588,7 @@

    OPAC View: - http:///cgi-bin/koha/opac-detail.pl?biblionumber= + /cgi-bin/koha/opac-detail.pl?biblionumber= _blank Open in new window

    --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1105,12 +1105,12 @@ [% IF ( SocialNetworks ) %] [% END %] --- a/opac/opac-shareshelf.pl +++ a/opac/opac-shareshelf.pl @@ -179,8 +179,7 @@ sub send_invitekey { my ($param) = @_; my $fromaddr = C4::Context->preference('KohaAdminEmailAddress'); my $url = - 'http://' - . C4::Context->preference('OPACBaseURL') + C4::Context->preference('OPACBaseURL') . "/cgi-bin/koha/opac-shareshelf.pl?shelfnumber=" . $param->{shelfnumber} . "&op=accept&key="; --- a/t/Auth_with_shibboleth.t +++ a/t/Auth_with_shibboleth.t @@ -27,7 +27,7 @@ use C4::Context; BEGIN { if ( check_install( module => 'Test::DBIx::Class' ) ) { - plan tests => 6; + plan tests => 9; } else { plan skip_all => "Need Test::DBIx::Class" } @@ -59,6 +59,7 @@ sub mockedConfig { } ### Mock ->preference +my $OPACBaseURL = "testopac.com"; $context->mock( 'preference', \&mockedPref ); sub mockedPref { @@ -66,7 +67,7 @@ sub mockedPref { my $return; if ( $param eq 'OPACBaseURL' ) { - $return = "testopac.com"; + $return = $OPACBaseURL; } return $return; @@ -237,8 +238,29 @@ subtest "checkpw_shib tests" => sub { }; ## _get_uri +$OPACBaseURL = "testopac.com"; is( C4::Auth_with_shibboleth::_get_uri(), "https://testopac.com", "https opac uri returned" ); +$OPACBaseURL = "http://testopac.com"; +my $result; +warnings_are { $result = C4::Auth_with_shibboleth::_get_uri() } + [ { carped => + 'Shibboleth requires OPACBaseURL to use the https protocol!' }, + ], + "improper protocol - received expected warning"; +is( $result, "https://testopac.com", "https opac uri returned" ); + +$OPACBaseURL = "https://testopac.com"; +is( C4::Auth_with_shibboleth::_get_uri(), + "https://testopac.com", "https opac uri returned" ); + +$OPACBaseURL = undef; +warnings_are { $result = C4::Auth_with_shibboleth::_get_uri() } + [ { carped => 'OPACBaseURL not set!' }, + ], + "undefined OPACBaseURL - received expected warning"; +is( $result, "https://", "https opac uri returned" ); + ## _get_shib_config # Internal helper function, covered in tests above --- a/t/db_dependent/Auth.t +++ a/t/db_dependent/Auth.t @@ -8,7 +8,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Test::MockModule; use List::MoreUtils qw/all any none/; -use Test::More tests => 6; +use Test::More tests => 8; use C4::Members; use Koha::AuthUtils qw/hash_password/; @@ -107,6 +107,34 @@ $dbh->{RaiseError} = 1; 'BZ9735: invalid language, then default to en'); } +# Check that there is always an OPACBaseURL set. +my $input = CGI->new(); +my ( $template1, $borrowernumber, $cookie ); +( $template1, $borrowernumber, $cookie ) = get_template_and_user( + { + template_name => "opac-detail.tt", + type => "opac", + query => $input, + authnotrequired => 1, + } +); + +ok( ( any { 'OPACBaseURL' eq $_ } keys %{$template1->{VARS}} ), + 'OPACBaseURL is in OPAC template' ); + +my ( $template2 ); +( $template2, $borrowernumber, $cookie ) = get_template_and_user( + { + template_name => "catalogue/detail.tt", + type => "intranet", + query => $input, + authnotrequired => 1, + } +); + +ok( ( any { 'OPACBaseURL' eq $_ } keys %{$template2->{VARS}} ), + 'OPACBaseURL is in Staff template' ); + my $hash1 = hash_password('password'); my $hash2 = hash_password('password'); --- a/t/db_dependent/Auth_with_cas.t +++ a/t/db_dependent/Auth_with_cas.t @@ -38,7 +38,7 @@ my $dbh = C4::Context->dbh; $dbh->{ AutoCommit } = 0; $dbh->{ RaiseError } = 1; -C4::Context->set_preference('OPACBaseURL','localhost'); +C4::Context->set_preference('OPACBaseURL','http://localhost'); my $opac_base_url = C4::Context->preference('OpacBaseURL'); my $query_string = 'ticket=foo&bar=baz'; --- a/t/db_dependent/Context.t +++ a/t/db_dependent/Context.t @@ -18,8 +18,34 @@ BEGIN { use_ok('C4::Context'); } -ok($koha = C4::Context->new, 'C4::Context->new'); ok($dbh = C4::Context->dbh(), 'Getting dbh from C4::Context'); + +$dbh->begin_work; +C4::Context->disable_syspref_cache(); +C4::Context->set_preference('OPACBaseURL','junk'); +C4::Context->clear_syspref_cache(); +my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); +is($OPACBaseURL,'http://junk','OPACBaseURL saved with http:// when missing it'); + +C4::Context->set_preference('OPACBaseURL','https://junk'); +C4::Context->clear_syspref_cache(); +$OPACBaseURL = C4::Context->preference('OPACBaseURL'); +is($OPACBaseURL,'https://junk','OPACBaseURL saved with https:// as specified'); + +C4::Context->set_preference('OPACBaseURL','http://junk2'); +C4::Context->clear_syspref_cache(); +$OPACBaseURL = C4::Context->preference('OPACBaseURL'); +is($OPACBaseURL,'http://junk2','OPACBaseURL saved with http:// as specified'); + +C4::Context->set_preference('SillyPreference','random'); +C4::Context->clear_syspref_cache(); +my $SillyPeference = C4::Context->preference('SillyPreference'); +is($SillyPeference,'random','SillyPreference saved as specified'); +C4::Context->clear_syspref_cache(); +C4::Context->enable_syspref_cache(); +$dbh->rollback; + +ok($koha = C4::Context->new, 'C4::Context->new'); ok($ret = C4::Context->KOHAVERSION, ' (function) KOHAVERSION = ' . ($ret||'')); ok($ret = $koha->KOHAVERSION, ' $koha->KOHAVERSION = ' . ($ret||'')); ok( --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -101,11 +101,6 @@ if ($email) { push( @results, $dat ); } - if ( C4::Context->preference('OPACBaseURL') ) { - $template2->param( - OPACBaseURL => C4::Context->preference('OPACBaseURL') ); - } - $template2->param( BIBLIO_RESULTS => \@results, email_sender => $mail{'from'}, --