From srdjan at catalyst.net.nz Mon May 16 08:07:41 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 16 May 2016 18:07:41 +1200 Subject: [Koha-patches] [PATCH] Bug 16504: Add regression tests Message-ID: <1463378861-9964-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart Signed-off-by: Srdjan --- t/db_dependent/Members/Attributes.t | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Members/Attributes.t b/t/db_dependent/Members/Attributes.t index f38ae41..e2ab1fe 100644 --- a/t/db_dependent/Members/Attributes.t +++ b/t/db_dependent/Members/Attributes.t @@ -25,7 +25,7 @@ use C4::Members::AttributeTypes; use Koha::Database; use t::lib::TestBuilder; -use Test::More tests => 53; +use Test::More tests => 55; use_ok('C4::Members::Attributes'); @@ -220,3 +220,35 @@ is( $borrower_attributes->[0]->{value}, $attributes->[1]->{value}, 'DeleteBorrow C4::Members::Attributes::DeleteBorrowerAttribute($borrowernumber, $attributes->[1]); $borrower_attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber); is( @$borrower_attributes, 1, 'DeleteBorrowerAttribute deletes a borrower attribute' ); + +# Regression tests for bug 16504 +C4::Context->set_userenv(123, 'userid', 'usercnum', 'First name', 'Surname', $new_library->{branchcode}, 'My Library', 0); +my $another_patron = $builder->build( + { source => 'Borrower', + value => { + firstname => 'my another firstname', + surname => 'my another surname', + categorycode => 'S', + branchcode => $new_library->{branchcode}, + } + } +); +$attributes = [ + { + value => 'my attribute1', + code => $attribute_type1->code(), + }, + { + value => 'my attribute2', + code => $attribute_type2->code(), + }, + { + value => 'my attribute limited', + code => $attribute_type_limited->code(), + } +]; +C4::Members::Attributes::SetBorrowerAttributes($another_patron->{borrowernumber}, $attributes); +$borrower_attributes = C4::Members::Attributes::GetBorrowerAttributes($another_patron->{borrowernumber}); +is( @$borrower_attributes, 3, 'SetBorrowerAttributes should have added the 3 attributes for another patron'); +$borrower_attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber); +is( @$borrower_attributes, 1, 'SetBorrowerAttributes should not have removed the attributes of other patrons' ); -- 2.7.4 From srdjan at catalyst.net.nz Mon May 16 08:08:54 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 16 May 2016 18:08:54 +1200 Subject: [Koha-patches] [PATCH] Bug 16504: (follow-up for bug 15163) Do not remove attributes of other patrons Message-ID: <1463378934-10434-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart Simple patch for a silly error, this single line is going to fix a critical bug. If a patron attribute is limited to a library, all the values for that attributes for every patrons will be deleted. Test plan: Create a patron attribute limited to a library Set the the attribute for a patron Set the the attribute for another patron => Without this patch applied, the attribute's value for the first patron is deleted => With this patch applied, the 2 values exist in the DB after the second edition Signed-off-by: Srdjan --- C4/Members/Attributes.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm index 1036e58..b269532 100644 --- a/C4/Members/Attributes.pm +++ b/C4/Members/Attributes.pm @@ -254,7 +254,7 @@ sub DeleteBorrowerAttributes { $query .= $branch_limit ? q{ LEFT JOIN borrower_attribute_types_branches ON bat_code = code - WHERE b_branchcode = ? OR b_branchcode IS NULL + WHERE ( b_branchcode = ? OR b_branchcode IS NULL ) AND borrowernumber = ? } : q{ -- 2.7.4 From srdjan at catalyst.net.nz Mon May 16 08:18:57 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 16 May 2016 18:18:57 +1200 Subject: [Koha-patches] [PATCH] Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl Message-ID: <1463379537-13876-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart The script opac/opac-addbybiblionumber.pl is not plack safe because the variable @biblios is declared with our and is not assigned to an empty array (so not reset). The issue: When trying to add items to a list (virtualshelf), the biblionumbers are added to the @biblios variable and the list is not reset between each run. Test plan: Check from records from the result list and add them to a list. Cancel or save and re-add them (or others) to a list (same or different). => Without this patch, the list of records will never stop growing, the previous items added are still listed when adding new ones. => With this patch, the behavior is the one expected. Signed-off-by: Srdjan --- opac/opac-addbybiblionumber.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index eec38bd..a5decf7 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -38,7 +38,7 @@ our $newvirtualshelf = $query->param('newvirtualshelf'); our $category = $query->param('category'); our $authorized = 1; our $errcode = 0; -our @biblios; +our @biblios = (); # if virtualshelves is disabled, leave immediately if ( ! C4::Context->preference('virtualshelves') ) { -- 2.7.4 From srdjan at catalyst.net.nz Tue May 17 02:33:50 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 17 May 2016 12:33:50 +1200 Subject: [Koha-patches] [PATCH] bug_15538: Koha::Logger in longoverdue.pl Message-ID: <1463445230-5408-1-git-send-email-srdjan@catalyst.net.nz> * Removed --verbose option and replaved verbose prints with $logger->info() --- misc/cronjobs/longoverdue.pl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index a0907a2..34ab1d0 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -40,9 +40,10 @@ use Getopt::Long; use C4::Log; use Pod::Usage; use Koha::Patrons; +use Koha::Logger; my $lost; # key=lost value, value=num days. -my ($charge, $verbose, $confirm, $quiet); +my ($charge, $confirm, $quiet); my $endrange = 366; my $mark_returned = 0; my $borrower_category = []; @@ -55,7 +56,6 @@ GetOptions( 'lost=s%' => \$lost, 'c|charge=s' => \$charge, 'confirm' => \$confirm, - 'v|verbose' => \$verbose, 'quiet' => \$quiet, 'maxdays=s' => \$endrange, 'mark-returned' => \$mark_returned, @@ -95,7 +95,7 @@ if ( $list_categories ) { =head1 SYNOPSIS longoverdue.pl [ --help | -h | --man | --list-categories ] - longoverdue.pl --lost | -l DAYS=LOST_CODE [ --charge | -c CHARGE_CODE ] [ --verbose | -v ] [ --quiet ] + longoverdue.pl --lost | -l DAYS=LOST_CODE [ --charge | -c CHARGE_CODE ] [ --quiet ] [ --maxdays MAX_DAYS ] [ --mark-returned ] [ --category BORROWER_CATEGORY ] ... [ --skip-category BORROWER_CATEGORY ] ... [ --commit ] @@ -123,10 +123,6 @@ This option takes the form of n=lv, where n is num days overdue, and lv is the l This specifies what lost value triggers Koha to charge the account for the lost item. Replacement costs are not charged if this is not specified. -=item B<--verbose | -v> - -verbose. - =item B<--confirm> confirm. without this option, the script will report the number of affected items and return without modifying any records. @@ -194,6 +190,8 @@ near-term release, so this script is not intended to have a long lifetime. =cut +my $logger = Koha::Logger->get({category => 'longoverdue'}); + # FIXME: We need three pieces of data to operate: # ~ lower bound (number of days), # ~ upper bound (number of days), @@ -223,7 +221,6 @@ if ( ! defined($charge) ) { } } unless ($confirm) { - $verbose = 1; # If you're not running it for real, then the whole point is the print output. print "### TEST MODE -- NO ACTIONS TAKEN ###\n"; } @@ -294,10 +291,10 @@ foreach my $startrange (sort keys %$lost) { if( my $lostvalue = $lost->{$startrange} ) { my ($date1) = bounds($startrange); my ($date2) = bounds( $endrange); - # print "\nRange ", ++$i, "\nDue $startrange - $endrange days ago ($date2 to $date1), lost => $lostvalue\n" if($verbose); - $verbose and - printf "\nRange %s\nDue %3s - %3s days ago (%s to %s), lost => %s\n", ++$i, - $startrange, $endrange, $date2, $date1, $lostvalue; + $logger->info( + sprintf "\nRange %s\nDue %3s - %3s days ago (%s to %s), lost => %s", + ++$i, $startrange, $endrange, $date2, $date1, $lostvalue + ); $sth_items->execute($startrange, $endrange, $lostvalue); $count=0; ITEM: while (my $row=$sth_items->fetchrow_hashref) { @@ -305,7 +302,10 @@ foreach my $startrange (sort keys %$lost) { my $category = uc Koha::Patrons->find( $row->{borrowernumber} )->categorycode(); next ITEM unless ( $category_to_process{ $category } ); } - printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); + $logger->info( + sprintf "Due %s: item %5s from borrower %5s to lost: %s", + $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue + ); if($confirm) { ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); LostItem($row->{'itemnumber'}, $mark_returned) if( $charge && $charge eq $lostvalue); -- 2.7.4 From srdjan at catalyst.net.nz Mon May 23 04:52:38 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 23 May 2016 14:52:38 +1200 Subject: [Koha-patches] [PATCH] Bug 16441: Do not use a package variable to cache C4::Letters::getletter Message-ID: <1463971958-10820-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart C4::Letters::getletter use a package variable (%letter) to cache letter returned by the subroutine. I have not found any direct issues caused by that but it is safer to remove it. It won't be a big deal to hit the DBMS to get a valid letter when needed. No test plan here, just confirm that the changes make sense. Signed-off-by: Srdjan --- C4/Letters.pm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index f327890..1d0c3c0 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -200,12 +200,6 @@ sub GetLettersAvailableForALibrary { } -# FIXME: using our here means that a Plack server will need to be -# restarted fairly regularly when working with this routine. -# A better option would be to use Koha::Cache and use a cache -# that actually works in a persistent environment, but as a -# short-term fix, our will work. -our %letter; sub getletter { my ( $module, $code, $branchcode, $message_transport_type ) = @_; $message_transport_type //= '%'; @@ -218,10 +212,6 @@ sub getletter { } $branchcode //= ''; - if ( my $l = $letter{$module}{$code}{$branchcode}{$message_transport_type} ) { - return { %$l }; # deep copy - } - my $dbh = C4::Context->dbh; my $sth = $dbh->prepare(q{ SELECT * @@ -234,7 +224,6 @@ sub getletter { my $line = $sth->fetchrow_hashref or return; $line->{'content-type'} = 'text/html; charset="UTF-8"' if $line->{is_html}; - $letter{$module}{$code}{$branchcode}{$message_transport_type} = $line; return { %$line }; } -- 2.7.4 From srdjan at catalyst.net.nz Mon May 23 05:00:50 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 23 May 2016 15:00:50 +1200 Subject: [Koha-patches] [PATCH] Bug 16459: Add patron to a patron card requires catalogue permission Message-ID: <1463972450-13613-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart Currently, serials => 'routing' is required, which does not make any sense. It's a copy/paste error when this file has been created (you can blame me). Note that I am not sure catalogue is the correct permission, but it's the one used almost everywhere in this module Test plan: Confirm that catalogue is enough to search for patrons to add to a patron card. Signed-off-by: Srdjan --- patroncards/add_user_search.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patroncards/add_user_search.pl b/patroncards/add_user_search.pl index 9bc3685..3d9f7af 100755 --- a/patroncards/add_user_search.pl +++ b/patroncards/add_user_search.pl @@ -35,7 +35,7 @@ my ( $template, $loggedinuser, $cookie, $staff_flags ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { serials => 'routing' }, + flagsrequired => { catalogue => 1 }, } ); -- 2.7.4 From srdjan at catalyst.net.nz Mon May 23 08:24:29 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 23 May 2016 18:24:29 +1200 Subject: [Koha-patches] [PATCH] Bug 16465: discharge - Add a title tag at the OPAC Message-ID: <1463984669-14443-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart Test plan: Confirm that the opac-discharge.pl has now a title Signed-off-by: Srdjan --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt index d8f5648..f6a3efc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt @@ -1,6 +1,6 @@ [% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Discharge +[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Discharge [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] -- 2.7.4 From srdjan at catalyst.net.nz Mon May 23 08:25:27 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 23 May 2016 18:25:27 +1200 Subject: [Koha-patches] [PATCH] Bug 16465: Fix typo issues vs checkouts Message-ID: <1463984727-14842-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart Test plan: Confirm the wording is correct Signed-off-by: Srdjan --- koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt index 45757d2..194b526 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt @@ -29,7 +29,7 @@ [% END %] [% UNLESS can_be_discharged %] -

Cannot edit discharge: borrower has issues.

+

Cannot edit discharge: the patron has checked out items.

[% ELSE %] [% IF has_reserves %]

Borrower has reserves: they will be canceled if the discharge is generated.

diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt index f6a3efc..3053bf7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt @@ -39,7 +39,7 @@ [% ELSIF pending %]

Your discharge will be available on this page within a few days.

[% ELSIF has_issues %] -

You cannot be discharged, you have issues. Please return items before asking for a discharge.

+

You cannot be discharged, you have checked out items. Please return items before asking for a discharge.

[% ELSIF not messages %]

What is a discharge?

This document certifies that you have returned all borrowed items. It is sometimes asked during a file transfer from a school to another. The discharge is sent by us to your school. You will also find it available on your reader account.

-- 2.7.4 From sjohnson at hpplnj.org Mon May 23 12:00:54 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Mon, 23 May 2016 06:00:54 -0400 Subject: [Koha-patches] Out of office Message-ID: <16b397782385433f9c525c4697fbe124@6af73a87a80647ee9e4bd0669045054c> I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjohnson at hpplnj.org Tue May 24 12:01:03 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Tue, 24 May 2016 06:01:03 -0400 Subject: [Koha-patches] Out of office Message-ID: <5aa2cb93c3c34236812e987053323375@1c053e9ece774a0999a16c181940d8f6> I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjohnson at hpplnj.org Wed May 25 12:00:50 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Wed, 25 May 2016 06:00:50 -0400 Subject: [Koha-patches] Out of office Message-ID: <5fdd398e96f6446988e2154a11e1f2c5@2f48169f43f940439ed8cb1415d1af22> I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From srdjan at catalyst.net.nz Thu May 26 02:02:10 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Thu, 26 May 2016 12:02:10 +1200 Subject: [Koha-patches] [PATCH] Bug 16502: Add additional test to Plugins.t Message-ID: <1464220930-5444-1-git-send-email-srdjan@catalyst.net.nz> From: Marcel de Rooy In order to verify if the delete now really works, we add one test in Plugins.t. Test plan: [1] Run the test. [2] Bonus: Comment line 63 in Plugins.t where delete is called. Run the test again. It should fail now. Signed-off-by: Srdjan --- t/db_dependent/Plugins.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t index 6cff239..308e215 100755 --- a/t/db_dependent/Plugins.t +++ b/t/db_dependent/Plugins.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 21; +use Test::More tests => 22; use File::Basename; use FindBin qw($Bin); use Archive::Extract; @@ -47,8 +47,8 @@ ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetP SKIP: { my $plugins_dir = C4::Context->config("pluginsdir"); - skip "plugindir not set", 3 unless defined $plugins_dir; - skip "plugindir not writable", 3 unless -w $plugins_dir; + skip "plugindir not set", 4 unless defined $plugins_dir; + skip "plugindir not writable", 4 unless -w $plugins_dir; # no need to skip further tests if KitchenSink would already exist my $ae = Archive::Extract->new( archive => "$Bin/KitchenSinkPlugin.kpz", type => 'zip' ); @@ -57,8 +57,12 @@ SKIP: { } use_ok('Koha::Plugin::Com::ByWaterSolutions::KitchenSink'); $plugin = Koha::Plugin::Com::ByWaterSolutions::KitchenSink->new({ enable_plugins => 1}); + my $table = $plugin->get_qualified_table_name( 'mytable' ); ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" ); Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink", enable_plugins => 1 }); + my $sth = C4::Context->dbh->table_info( undef, undef, $table, 'TABLE' ); + my $info = $sth->fetchall_arrayref; + is( @$info, 0, "Table $table does no longer exist" ); ok( !( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" ), "Koha::Plugins::Handler::delete works correctly." ); } -- 2.7.4 From srdjan at catalyst.net.nz Thu May 26 02:02:26 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Thu, 26 May 2016 12:02:26 +1200 Subject: [Koha-patches] [PATCH] Bug 16502: Adjust test for GetPlugins Message-ID: <1464220946-5586-1-git-send-email-srdjan@catalyst.net.nz> From: Marcel de Rooy The current test assumes that GetPlugins will return the test plugin as the first one in the array. This is not correct. This patch adjusts the test to a grep. Test plan: Run the test. Bonus: Add additional plugins. Run the test again. Signed-off-by: Srdjan --- t/db_dependent/Plugins.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t index 308e215..73ce65b 100755 --- a/t/db_dependent/Plugins.t +++ b/t/db_dependent/Plugins.t @@ -43,7 +43,8 @@ ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' ); my @plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins( 'report' ); -ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetPlugins functions correctly" ); +my @names = map { $_->get_metadata()->{'name'} } @plugins; +is( scalar grep( /^Test Plugin$/, @names), 1, "Koha::Plugins::GetPlugins functions correctly" ); SKIP: { my $plugins_dir = C4::Context->config("pluginsdir"); -- 2.7.4 From srdjan at catalyst.net.nz Thu May 26 02:03:56 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Thu, 26 May 2016 12:03:56 +1200 Subject: [Koha-patches] [PATCH] Bug 16502: Replace a few other ok-calls by is-calls Message-ID: <1464221036-6143-1-git-send-email-srdjan@catalyst.net.nz> From: Marcel de Rooy Trivial changes that speak for themselves.. Signed-off-by: Marcel de Rooy Signed-off-by: Srdjan --- t/db_dependent/Plugins.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t index 73ce65b..403d7c4 100755 --- a/t/db_dependent/Plugins.t +++ b/t/db_dependent/Plugins.t @@ -34,13 +34,13 @@ ok( $plugin->can('configure'), 'Test plugin can configure' ); ok( $plugin->can('install'), 'Test plugin can install' ); ok( $plugin->can('uninstall'), 'Test plugin can install' ); -ok( Koha::Plugins::Handler->run({ class => "Koha::Plugin::Test", method => 'report', enable_plugins => 1 }) eq "Koha::Plugin::Test::report", 'Test run plugin report method' ); +is( Koha::Plugins::Handler->run({ class => "Koha::Plugin::Test", method => 'report', enable_plugins => 1 }), "Koha::Plugin::Test::report", 'Test run plugin report method' ); my $metadata = $plugin->get_metadata(); -ok( $metadata->{'name'} eq 'Test Plugin', 'Test $plugin->get_metadata()' ); +is( $metadata->{'name'}, 'Test Plugin', 'Test $plugin->get_metadata()' ); -ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' ); -ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' ); +is( $plugin->get_qualified_table_name('mytable'), 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' ); +is( $plugin->get_plugin_http_path(), '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' ); my @plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins( 'report' ); my @names = map { $_->get_metadata()->{'name'} } @plugins; -- 2.7.4 From sjohnson at hpplnj.org Thu May 26 12:00:57 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Thu, 26 May 2016 06:00:57 -0400 Subject: [Koha-patches] Out of office Message-ID: I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjohnson at hpplnj.org Fri May 27 12:01:10 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Fri, 27 May 2016 06:01:10 -0400 Subject: [Koha-patches] Out of office Message-ID: <734258abfdbb4a668993ddc239051500@dd1b21bd8cc64f31896e461bd816a809> I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjohnson at hpplnj.org Sat May 28 12:00:40 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Sat, 28 May 2016 06:00:40 -0400 Subject: [Koha-patches] Out of office Message-ID: <17e89ff8d68344e188f3b90e6a9d0104@0b0bc703005043e297e20dd5ed01ed90> I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjohnson at hpplnj.org Sun May 29 12:00:34 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Sun, 29 May 2016 06:00:34 -0400 Subject: [Koha-patches] Out of office Message-ID: I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From srdjan at catalyst.net.nz Mon May 30 06:43:50 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 30 May 2016 16:43:50 +1200 Subject: [Koha-patches] [PATCH] Bug 16575 - Irregular behaviour using window.print() followed by window.location.href= Message-ID: <1464583430-15995-1-git-send-email-srdjan@catalyst.net.nz> From: David Cook Use print.css for OPAC basket when printing instead of using navigation. Currently, when you click "Print" on the OPAC basket, it'll navigate to a new page and initiate window.print() followed by a window.location.href change again. Unfortunately, due to differences in IE, Chrome, and FF, it will either show the print options, navigate away without showing them, or refuse to navigate away after printing. By changing to using print.css, we don't navigate away from the basket in the first place, so we prevent this irregular behaviour. _TEST PLAN_ 1) Apply the patch 2) Create an OPAC basket by clicking "Add to cart" on multiple items 3) Using Chrome, IE, and Firefox (of any version), click the "Print" button 4) You should see the relevant print menu without the OPAC basket re-loading in any way. 5) After printing is complete, you should still be on the OPAC basket pop-up Signed-off-by: Srdjan --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index fa7e496..11702a9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -16,7 +16,7 @@

Your cart

[% UNLESS ( print_basket ) %] -
+
[% IF ( verbose ) %] Brief display [% ELSE %] @@ -26,12 +26,12 @@ Send [% END %] Download - Print + Print Empty and close Hide window
-
+
Select all Clear all | -- 2.7.4 From srdjan at catalyst.net.nz Mon May 30 07:00:29 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 30 May 2016 17:00:29 +1200 Subject: [Koha-patches] [PATCH] Bug 16582 t/Price.t test should pass if Test::DBIx::Class is not available Message-ID: <1464584429-22330-1-git-send-email-srdjan@catalyst.net.nz> From: Mark Tompsett This patch makes it so 00-load.t doesn't cause 'prove t' to prematurely die before reaching other tests. TEST PLAN --------- 1) prove t -- dies on 00-load.t 2) apply patch 3) prove t -- now t/Prices.t should be the failure. Signed-off-by: Srdjan --- t/00-load.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/00-load.t b/t/00-load.t index 21b62eb..f0ba029 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -60,6 +60,7 @@ find( $m =~ s{^.*/Koha/}{Koha/}; $m =~ s{/}{::}g; return if $m =~ /Koha::NorwegianPatronDB/; # uses non-mandatory modules + return if $m =~ /[eE]lastic[sS]earch/; # Elastic search libraries are breaking tests use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'"); }, }, -- 2.7.4 From srdjan at catalyst.net.nz Mon May 30 07:03:47 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 30 May 2016 17:03:47 +1200 Subject: [Koha-patches] [PATCH] Bug 16582 t/Price.t test should pass if Test::DBIx::Class is not available Message-ID: <1464584627-23510-1-git-send-email-srdjan@catalyst.net.nz> From: Mark Tompsett TEST PLAN --------- 1) prove t/Prices.t -- failure 2) apply patch 3) prove t/Prices.t -- nicely skipped when Test::DBIx::Class is not available. Signed-off-by: Srdjan --- t/Prices.t | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/t/Prices.t b/t/Prices.t index d6bfda2..74d2eac 100644 --- a/t/Prices.t +++ b/t/Prices.t @@ -1,15 +1,23 @@ use Modern::Perl; -use Test::More tests => 17; +use Test::More; use Test::MockModule; use t::lib::Mocks; +use Module::Load::Conditional qw/check_install/; + BEGIN { - use_ok('C4::Acquisition'); - use_ok('C4::Bookseller'); - use_ok('C4::Context'); - use_ok('Koha::Number::Price'); -}; + if ( check_install( module => 'Test::DBIx::Class' ) ) { + plan tests => 17; + } else { + plan skip_all => "Need Test::DBIx::Class" + } +} + +use_ok('C4::Acquisition'); +use_ok('C4::Bookseller'); +use_ok('C4::Context'); +use_ok('Koha::Number::Price'); t::lib::Mocks::mock_preference( 'gist', '0.02|0.05|0.196' ); -- 2.7.4 From srdjan at catalyst.net.nz Mon May 30 08:10:56 2016 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 30 May 2016 18:10:56 +1200 Subject: [Koha-patches] [PATCH] Bug 16540: Translatability in opac-auth.tt (tag-splitted sentences) Message-ID: <1464588656-13627-1-git-send-email-srdjan@catalyst.net.nz> From: Marc V?ron This patch removes tag-splitting from 2 sentences in pac-auth.tt To test: - Review code changes and verify that following sentences are no longer splitted by -tags: "Logout and try again with a different user" "Try to log in using a different Google account" UPDATE: Amended to fix a tiny typo Signed-off-by: Srdjan --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt index 3b1aac3..23a2918 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt @@ -30,7 +30,7 @@

Access denied

Sorry, the system doesn't think you have permission to access this page.

[% IF SCO_login %] -

Logout and try again with a different user

+

Logout and try again with a different user

[% END %]
[% END %] @@ -146,7 +146,7 @@

Google login

Sorry, your Google login failed. [% invalidGoogleOpenIDConnectLogin %]

Please note that the Google login will only work if you are using the e-mail address registered with this library.

-

If you want to, you can try to log in using a different account +

Try to log in using a different Google account [% END %] Log in with Google

If you do not have a Google account, but do have a local account, you can still log in:

-- 2.7.4 From sjohnson at hpplnj.org Mon May 30 12:01:39 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Mon, 30 May 2016 06:01:39 -0400 Subject: [Koha-patches] Out of office Message-ID: I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjohnson at hpplnj.org Tue May 31 12:01:14 2016 From: sjohnson at hpplnj.org (sjohnson at hpplnj.org) Date: Tue, 31 May 2016 06:01:14 -0400 Subject: [Koha-patches] Out of office Message-ID: <878c679c45fe444ca92ca0a24554e662@fd2de5356beb4aa2bcfc43d31fd2a3d8> I will be out of the library May 18, 2016 - June 6, 2016. I will periodically check my email and either get back to you or forward your email to a colleague to answer your query. If you have an urgent need please call the library at 732-572-2750. Thank you, Sherry Johnson Coordinator of Adult Services Highland Park Public Library www.hpplnj.org 732-572-2750 -------------- next part -------------- An HTML attachment was scrubbed... URL: