Bugzilla – Attachment 52365 Details for
Bug 14576
Allow automatic update of location on checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14576 (QA Folllowup) Address issues
Bug-14576-QA-Folllowup-Address-issues.patch (text/plain), 6.34 KB, created by
Nick Clemens (kidclamp)
on 2016-06-14 10:32:16 UTC
(
hide
)
Description:
Bug 14576 (QA Folllowup) Address issues
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-06-14 10:32:16 UTC
Size:
6.34 KB
patch
obsolete
>From cbe39c678949a52ea8c11992b801f21b035da47d Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 14 Jun 2016 06:26:31 -0400 >Subject: [PATCH] Bug 14576 (QA Folllowup) Address issues > >use mock for tests >use a separate variable for yaml >fix indentation >--- > C4/Circulation.pm | 10 +++++----- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 4 ++-- > t/db_dependent/Circulation/issue.t | 8 ++++---- > 4 files changed, 13 insertions(+), 13 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 6dc2878..101cb51 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1429,7 +1429,7 @@ sub AddIssue { > > if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' ) { > ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. >- CartToShelf( $item->{'itemnumber'} ); >+ CartToShelf( $item->{'itemnumber'} ); > } > $item->{'issues'}++; > if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { >@@ -1934,11 +1934,11 @@ sub AddReturn { > > my $borrowernumber = $borrower->{'borrowernumber'} || undef; # we don't know if we had a borrower or not > >- my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin'); >- if ($yaml) { >- $yaml = "$yaml\n\n"; # YAML is strict on ending \n. Surplus does not hurt >+ my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin'); >+ if ($yaml_loc) { >+ $yaml_loc = "$yaml_loc\n\n"; # YAML is strict on ending \n. Surplus does not hurt > my $rules; >- eval { $rules = YAML::Load($yaml); }; >+ eval { $rules = YAML::Load($yaml_loc); }; > if ($@) { > warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@"; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 10e1b09..61de9f9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -484,7 +484,7 @@ $(document).ready(function () { > from > [% IF errmsgloo.ItemLocationUpdated.from %] > [% IF errmsgloo.ItemLocationUpdated.from == '' %] >- empty >+ empty > [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %] > [% errmsgloo.ItemLocationUpdated.from %] (No description available) > [% ELSE %] >@@ -496,7 +496,7 @@ $(document).ready(function () { > to > [% IF errmsgloo.ItemLocationUpdated.to %] > [% IF errmsgloo.ItemLocationUpdated.to == '' %] >- empty >+ empty > [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %] > [% errmsgloo.ItemLocationUpdated.to %] (No description available) > [% ELSE %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >index 4db6750..ff74b02 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >@@ -148,8 +148,8 @@ $( document ).ready( function () { > var reg_check = /.*:\s.*/; > for (var i=0; i < split_text.length; i++){ > if ( !split_text[i].match(reg_check) && split_text[i].length ) { >- alert_issues+=split_text[i]+"\n"; >- issue_count++; >+ alert_issues+=split_text[i]+"\n"; >+ issue_count++; > } > } > if (issue_count) alert_text += "\n"+_("The following values are not formatted correctly:")+"\n"+alert_issues; >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index 2698ae4..13e7e9b 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -400,12 +400,12 @@ my $itemnumber2; > $biblionumber > ); > >-C4::Context->set_preference( 'UpdateItemLocationOnCheckin', q{} ); >+t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', q{} ); > AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); > my $item2 = GetItem( $itemnumber2 ); > ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' ); > >-C4::Context->set_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' ); >+t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' ); > AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); > $item2 = GetItem( $itemnumber2 ); > ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} ); >@@ -414,7 +414,7 @@ AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); > $item2 = GetItem( $itemnumber2 ); > ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} ); > >-C4::Context->set_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' ); >+t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' ); > AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); > $item2 = GetItem( $itemnumber2 ); > ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} ); >@@ -423,7 +423,7 @@ AddIssue( $borrower_1, 'barcode_4', $daysago10,0, $today, '' ); > $item2 = GetItem( $itemnumber2 ); > ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} ); > >-C4::Context->set_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" ); >+t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" ); > AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); > $item2 = GetItem( $itemnumber2 ); > ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14576
:
46454
|
46455
|
46456
|
48258
|
48259
|
50662
|
50663
|
52195
|
52196
|
52197
|
52204
|
52205
|
52206
|
52222
|
52223
|
52224
|
52365
|
53112
|
53113
|
53114
|
53115
|
54281
|
54644
|
54645
|
54646
|
54647
|
54648
|
54654
|
55587
|
60658
|
60659
|
60660
|
60661
|
60662
|
60663
|
60747
|
60748
|
60751
|
61940
|
61941
|
61942
|
61944
|
61945
|
61946
|
61947
|
61948
|
61949
|
61950
|
64656
|
64657
|
64658
|
67610
|
67611
|
68297
|
70795
|
70796
|
70797
|
72032
|
72033
|
72034
|
75661
|
75662
|
75663
|
79245
|
79246
|
79995
|
79996
|
83113
|
83114
|
83115
|
83696
|
83697
|
83698
|
85406
|
85850
|
85851
|
85852
|
85853
|
86812
|
86813
|
86814
|
86815
|
86816
|
87040
|
87061
|
87144
|
87145
|
87146
|
87147
|
87148
|
87149
|
87150
|
87151
|
87925
|
88451
|
88452
|
88453
|
88454
|
88455
|
88456
|
88457
|
88458
|
88459
|
88646
|
88647
|
88648
|
88649
|
88650
|
88651
|
88652
|
88653
|
88654