Bugzilla – Attachment 66712 Details for
Bug 16401
System preference staffClientBaseURL hardcoded to 'http://'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16401: System preference staffClientBaseURL hardcoded to 'http://'
Bug-16401-System-preference-staffClientBaseURL-har.patch (text/plain), 6.59 KB, created by
Nick Clemens (kidclamp)
on 2017-09-01 11:32:14 UTC
(
hide
)
Description:
Bug 16401: System preference staffClientBaseURL hardcoded to 'http://'
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-09-01 11:32:14 UTC
Size:
6.59 KB
patch
obsolete
>From 67b34ec804be6174a8cb47f970fd021065426cea Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Tue, 15 Aug 2017 17:23:00 +0200 >Subject: [PATCH] Bug 16401: System preference staffClientBaseURL hardcoded to > 'http://' > >Test plan: >1) Insert some value to staffBaseURL preference, without starting http:// >2) Apply the patch >3) Update database >4) Go to system preferences adminsitration, find the staffBaseURL >preference, the inserted value should be prepended with 'http://' and >the comment should be "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 CAS, svc, and load_testing to work.)" >5) prove t/db_dependent/Auth_with_cas.t >6) prove t/db_dependent/selenium/basic_workflow.t >7) prove t/db_dependent/check_sysprefs.t > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > installer/data/mysql/atomicupdate/bug_16401.perl | 8 ++++++++ > installer/data/mysql/sysprefs.sql | 2 +- > .../prog/en/modules/admin/preferences/staff_client.pref | 4 ++-- > svc/import_bib | 2 +- > t/db_dependent/Auth_with_cas.t | 2 +- > t/db_dependent/selenium/basic_workflow.t | 2 +- > 6 files changed, 14 insertions(+), 6 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_16401.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_16401.perl b/installer/data/mysql/atomicupdate/bug_16401.perl >new file mode 100644 >index 0000000..946953c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_16401.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( "UPDATE systempreferences SET value = CONCAT('http://', value) WHERE variable = 'staffClientBaseURL' AND value NOT LIKE 'http%'" ); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 16401 - fix potentialy bad set staffClientBaseURL preference)\n"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 1cad43e..2e6c82e 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -494,7 +494,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'), > ('SpineLabelFormat','<itemcallnumber><copynumber>','30|10','This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.','Textarea'), > ('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'), >-('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'), >+('staffClientBaseURL','',NULL,'Specify the base URL of the staff client starting with http:// or https://. Do not include a trailing slash in the URL. (This must be filled in correctly for CAS, svc, and load_testing to work.)','free'), > ('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'), > ('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'), > ('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the Staff client','Integer'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >index e7da2e8..0ee8ffe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >@@ -6,10 +6,10 @@ Staff Client: > choices: staff-templates > - theme on the staff interface. > - >- - "The staff client is located at http://" >+ - "The staff client is located at" > - pref: staffClientBaseURL > class: url >- - . Do not include a trailing slash in the URL. >+ - 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 CAS, svc, and load_testing to work.) > - > - Use the CSS stylesheet > - pref: intranetstylesheet >diff --git a/svc/import_bib b/svc/import_bib >index a23b72d..c611224 100755 >--- a/svc/import_bib >+++ b/svc/import_bib >@@ -98,7 +98,7 @@ sub import_bib { > $sth = $dbh->prepare("SELECT overlay_status FROM import_records WHERE import_record_id =?"); > $sth->execute($import_record_id); > my $match_status = $sth->fetchrow_arrayref->[0] || 'no_match'; >- my $url = 'http://'. C4::Context->preference('staffClientBaseURL') .'/cgi-bin/koha/catalogue/detail.pl?biblionumber='. $biblionumber; >+ my $url = C4::Context->preference('staffClientBaseURL') .'/cgi-bin/koha/catalogue/detail.pl?biblionumber='. $biblionumber; > > $result->{'status'} = "ok"; > $result->{'import_batch_id'} = $batch_id; >diff --git a/t/db_dependent/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t >index a58300a..5389d2e 100755 >--- a/t/db_dependent/Auth_with_cas.t >+++ b/t/db_dependent/Auth_with_cas.t >@@ -41,7 +41,7 @@ $dbh->{ RaiseError } = 1; > > C4::Context->disable_syspref_cache(); > t::lib::Mocks::mock_preference('OPACBaseURL','http://localhost'); >-t::lib::Mocks::mock_preference('staffClientBaseURL','localhost:8080'); >+t::lib::Mocks::mock_preference('staffClientBaseURL','http://localhost:8080'); > > my $opac_base_url = C4::Context->preference('OpacBaseURL'); > my $staff_base_url = C4::Context->preference('staffClientBaseURL'); >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index f439dac..dadf99b 100644 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -45,7 +45,7 @@ use MARC::Field; > my $dbh = C4::Context->dbh; > my $login = 'koha'; > my $password = 'koha'; >-my $base_url= ( $ENV{KOHA_INTRANET_URL} || 'http://'.C4::Context->preference("staffClientBaseURL") ) . "/cgi-bin/koha/"; >+my $base_url= ( $ENV{KOHA_INTRANET_URL} || C4::Context->preference("staffClientBaseURL") ) . "/cgi-bin/koha/"; > > > my $number_of_biblios_to_insert = 3; >-- >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 16401
:
66025
|
66143
|
66712
|
67268
|
67269
|
67270
|
67271
|
67918
|
67919
|
67967