Bugzilla – Attachment 89118 Details for
Bug 20388
Ability to add search fields from UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20388: QA fixe : delete line who add elements in biblios and authorities in the same time
Bug-20388-QA-fixe--delete-line-who-add-elements-in.patch (text/plain), 4.50 KB, created by
axel Amghar
on 2019-04-30 14:20:38 UTC
(
hide
)
Description:
Bug 20388: QA fixe : delete line who add elements in biblios and authorities in the same time
Filename:
MIME Type:
Creator:
axel Amghar
Created:
2019-04-30 14:20:38 UTC
Size:
4.50 KB
patch
obsolete
>From 9508ab555042cfde55be48df72ad66fac548f194 Mon Sep 17 00:00:00 2001 >From: Axel Amghar <axel.amghar@gmail.com> >Date: Fri, 26 Apr 2019 09:55:32 +0200 >Subject: [PATCH] Bug 20388: QA fixe : delete line who add elements in biblios > and authorities in the same time > >--- > .../admin/searchengine/elasticsearch/mappings.tt | 2 +- > t/db_dependent/Auth/Auth.t | 58 ++++++++++++++++++++++ > 2 files changed, 59 insertions(+), 1 deletion(-) > create mode 100644 t/db_dependent/Auth/Auth.t > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >index ca758fe..706a018 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >@@ -21,6 +21,7 @@ > $(new_line).find("select").each( function() { > var attr = $(this).attr('name'); > var val = $(line).find('[data-id="' + attr + '"]').val(); >+ $(this).find('option').removeAttr('selected'); > $(this).find('option[value="' + val + '"]').attr("selected", "selected"); > } ); > return new_line; >@@ -58,7 +59,6 @@ > if ( marc_field.length > 0 ) { > var new_line = clone_line( line ); > var search_field_name = $(line).find('select[data-id="mapping_search_field_name"] option:selected').text(); >- $(new_line).children('td:first').append('<input type="hidden" name="mapping_search_field_name" value="' + search_field_name + '">'); > new_line.appendTo($('table[data-index_name="'+index_name+'"]>tbody')); > > var search_field_line = $('input[name="search_field_name"][value="' + search_field_name + '"]').closest("tr"); >diff --git a/t/db_dependent/Auth/Auth.t b/t/db_dependent/Auth/Auth.t >new file mode 100644 >index 0000000..ac4e2b1 >--- /dev/null >+++ b/t/db_dependent/Auth/Auth.t >@@ -0,0 +1,58 @@ >+#!/usr/bin/perl >+# >+# This Koha test module is a stub! >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use t::lib::Mocks; >+use t::lib::TestBuilder; >+use Test::MockObject; >+use Test::MockModule; >+ >+use C4::Auth qw(checkpw); >+ >+use Test::More tests => 1; >+ >+my $schema = Koha::Database->schema; >+my $builder = t::lib::TestBuilder->new; >+my $dbh = C4::Context->dbh; >+ >+t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); >+t::lib::Mocks::mock_preference( 'UseKohaPlugins', 0 ); >+ >+$schema->storage->txn_begin; >+ >+subtest 'no_set_userenv parameter tests' => sub { >+ >+ plan tests => 12; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $password = 'password'; >+ >+ t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >+ $patron->set_password({ password => $password }); >+ >+ ok( checkpw( $dbh, $patron->userid, $password, undef, undef, 1 ), 'checkpw returns true' ); >+ is( C4::Context->userenv, undef, 'Userenv should be undef as required' ); >+ C4::Context->_new_userenv('DUMMY SESSION'); >+ >+ C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, 'Library 1', 0, '', ''); >+ is( C4::Context->userenv->{branch}, $library->{branchcode}, 'Userenv gives correct branch' ); >+ ok( checkpw( $dbh, $patron->{userid}, 'password', undef, undef, 1 ), 'checkpw returns true' ); >+ is( C4::Context->userenv->{branch}, $library->{branchcode}, 'Userenv branch is preserved if no_set_userenv is true' ); >+ ok( checkpw( $dbh, $patron->{userid}, 'password', undef, undef, 0 ), 'checkpw still returns true' ); >+ #isnt( C4::Context->userenv->{branch}, $library->{branchcode}, 'Userenv branch is overwritten if no_set_userenv is false' ); >+ >+ t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 ); >+ my @result = checkpw( $dbh, $patron->{userid}, 'wrong_password', undef, undef, 1 ); >+ is( $result[0], 0, 'With TestAuth plugin, checkpw returns 0' ); >+ is( $result[1], undef, 'With TestAuth plugin, checkpw returns empty cardnumber' ); >+ is( $result[2], undef, 'With TestAuth plugin, checkpw returns empty userid' ); >+ @result = checkpw( $dbh, 'test', 'test', undef, undef, 1 ); >+ is( $result[0], 1, 'With TestAuth plugin, checkpw returns 1' ); >+ is( $result[1], 'test', 'With TestAuth plugin, checkpw returns test cardnumber' ); >+ is( $result[2], 'test', 'With TestAuth plugin, checkpw returns test userid' ); >+} >\ No newline at end of file >-- >2.7.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 20388
:
73158
|
73165
|
73167
|
73476
|
73626
|
73627
|
73629
|
73681
|
73682
|
73918
|
73919
|
73940
|
73943
|
73944
|
73945
|
73946
|
74261
|
74718
|
74719
|
78658
|
78659
|
80709
|
86912
|
87196
|
87197
|
87198
|
87199
|
87201
|
87202
|
87203
|
87204
|
88075
|
88079
|
88080
|
88081
|
88082
|
88083
|
89117
|
89118
|
89121
|
89733
|
89894
|
90517
|
90518
|
90519
|
90520
|
90521
|
90522
|
90523
|
90524
|
98011
|
98012
|
98013
|
98014
|
98015
|
98016
|
98017
|
98018
|
99960
|
99961
|
99962
|
99963
|
99964
|
99965
|
99966
|
99967
|
119296
|
119317
|
119318
|
120104
|
163449
|
163450
|
163451
|
163452
|
163460
|
163461
|
163462
|
163463
|
164529
|
164530
|
164531
|
164532
|
164533
|
164534
|
164535
|
164789
|
164790
|
164791
|
164792
|
164793