If you send a cart or a list to an email address from the staff client, each record contains an incomplete link: In the online catalog: /cgi-bin/koha/opac-detail.pl?biblionumber=306 Assuming a link back to the OPAC is correct*, the scripts should use the OPACBaseURL variable to form a complete link. * One could argue that a cart/list sent from the staff client should link back to the staff client, but I think there is enough of a potential that staff will be sending carts/lists to patrons that it should be a link to the OPAC.
I agree - however many libraries don't fill that variable out. Is there a way to grab it from the server? I also agree that the staff cart links should also go to the opac. If we want it to use the sys pref I can make the change.
My fix for Bug 6957 will address this issue by hiding the link if the OPACBaseURL preference is not filled out.
This is still a problem on current master: Mailing a cart from the staff client I my URLs look like: /cgi-bin/koha/opac-detail.pl?biblionumber=11 Mailing a cart from the OPAC my URLs look like: http://localhost/cgi-bin/koha/opac-detail.pl?biblionumber=11 staffClientBaseURL = localhost:8080 OpacBaseURL = localost
A note that since ug 8368 the link is also broken in the OPAC for send cart and send list. "http://" was removed before the OPACBaseURL variable, so the link is now "localhost/cgi-bin/koha/opac-detail.pl?biblionumber=11"
Created attachment 22945 [details] [review] Patch to fix and use OPACBaseURL on all send list and send basket pages Fix use of OPACBaseURL on send list(shelf) and send basket of OPAC and staff client. To test, try sending a list and a basket in both opac and staff pages. All links should contains http:// followed by OPACBaseURL. If OPACBaseURL isn't set in the preferences, no links should be in the email. I hardcoded "http://" everywhere because no decision were taken in bug #7770, so the preference description still says that the http:// shouldn't be in OPACBaseURL.
I have looked into this a bit, it seems that for the OPAC cart the problem does not exist and I think I found the reason in Auth.pm: OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"), I will try to provide an alternative patch trying to fix it using that logic, so we don't need to hardcode http:// or https:// into the templates.
Hm ok, as discussed on IRC: The solution in Auth.pm is not quite right either because it totally ignores the syspref setting. I think a combination of the http/https bit + checking the syspref could do it. For multiple OPACs you can now overwrite the OpacBaseURL in your apache configuration.
Created attachment 23436 [details] [review] Bug 5010: Send list emails with complete links back into the catalog This patch adapts the way the links in the cart email in OPAC are generated for the list emails. The OpacBaseURL variable is generated from code in Auth.pm. To test: - Create a list - Email yourself the list Note: Email is sent directly and not via messagequeue table - Verify the links back into the catalog are missing http(s):// - Apply the patch - Email yourself the list again - Verify the links are now ok and working Note: The way Auth.pm generates the OpacBaseURL is not correct, as it does not take into account the OpacBaseURL system preference. This patch makes both emails sent from OPAC rely on the same code and is an improvement over the current behaviour.
The first patch makes sure the URL in the list email is generated like everywhere else in the OPAC. The same method won't work for the intranet and the OPACBaseURL is not taken into account at all. This is what creates the OpacBaseURL in OPAC from Auth.pm: (($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"))), Feedback and ideas welcome... the attached patch could still be a small improvement as it adds consistency and makes the link work.
Created attachment 23457 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new system preference: PublicCatalogUsesSSL. To test: - Create a list - Send yourself the list from the staff interface - Verify that the links are http://<OPACBaseURL> - Put some records into your cart - Send yourself the cart from the staff interface - Verify that the links are missing http(s):// in front of them - Apply patch - Run database update - Verify that the default setting for PublicCatalogUsesSSL is 'doesn't use' - Resent both emails - Verfiy the catalog links are now both http:// links - Change system preference setting to 'uses' - Resent both emails - Verify the catalog links are now https:// links
NOTE: 2 last patches here are alternatives to the first patch, trying to avoid hardcoding the http:// into the templates.
Comment on attachment 22945 [details] [review] Patch to fix and use OPACBaseURL on all send list and send basket pages Second set of patches looks more thorough. Testing them.
I just realized that I would prefer the system preference to be right beside (above preferably) the OPACBaseURL system preference. Because, the text of the OPACBaseURL probably needs tweaking too.
mtompset@ubuntu:~/kohaclone$ git bz apply 5010 Bug 5010 - Incomplete links in carts and lists sent from the staff client 23436 - Bug 5010: Send list emails with complete links back into the catalog 23457 - Bug 5010: Fix incomplete links in carts and lists sent from the staff client Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 5010: Send list emails with complete links back into the catalog Applying: Bug 5010: Fix incomplete links in carts and lists sent from the staff client /home/mtompset/kohaclone/.git/rebase-apply/patch:58: trailing whitespace. $dbh->do(q{INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES /home/mtompset/kohaclone/.git/rebase-apply/patch:80: trailing whitespace. choices: warning: 2 lines add whitespace errors. Using index info to reconstruct a base tree... <stdin>:58: trailing whitespace. $dbh->do(q{INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES <stdin>:80: trailing whitespace. choices: warning: 2 lines applied after fixing whitespace errors. Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref Auto-merging installer/data/mysql/updatedatabase.pl Auto-merging installer/data/mysql/sysprefs.sql Auto-merging basket/sendbasket.pl Ugly but it applies. :)
Created attachment 25877 [details] [review] [SIGNED OFF] Bug 5010: Send list emails with complete links back into the catalog This patch adapts the way the links in the cart email in OPAC are generated for the list emails. The OpacBaseURL variable is generated from code in Auth.pm. To test: - Create a list - Email yourself the list Note: Email is sent directly and not via messagequeue table - Verify the links back into the catalog are missing http(s):// - Apply the patch - Email yourself the list again - Verify the links are now ok and working Note: The way Auth.pm generates the OpacBaseURL is not correct, as it does not take into account the OpacBaseURL system preference. This patch makes both emails sent from OPAC rely on the same code and is an improvement over the current behaviour. Tested both together using steps similar to larger test plan. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 25878 [details] [review] [SIGNED OFF] Bug 5010: Send list emails with complete links back into the catalog This patch adapts the way the links in the cart email in OPAC are generated for the list emails. The OpacBaseURL variable is generated from code in Auth.pm. To test: - Create a list - Email yourself the list Note: Email is sent directly and not via messagequeue table - Verify the links back into the catalog are missing http(s):// - Apply the patch - Email yourself the list again - Verify the links are now ok and working Note: The way Auth.pm generates the OpacBaseURL is not correct, as it does not take into account the OpacBaseURL system preference. This patch makes both emails sent from OPAC rely on the same code and is an improvement over the current behaviour. Tested both together using steps similar to larger test plan. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 25879 [details] [review] [SIGNED OFF] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new system preference: PublicCatalogUsesSSL. To test: - Create a list - Send yourself the list from the staff interface - Verify that the links are http://<OPACBaseURL> - Put some records into your cart - Send yourself the cart from the staff interface - Verify that the links are missing http(s):// in front of them - Apply patch - Run database update - Verify that the default setting for PublicCatalogUsesSSL is 'doesn't use' - Resent both emails - Verfiy the catalog links are now both http:// links - Change system preference setting to 'uses' - Resent both emails - Verify the catalog links are now https:// links NOTE: My cart didn't have a 'In online catalog:' line on master. My list had http:// on master. System preference affected both cart and list sending. System preference necessary, because there is no way to determine http or https in the middle of an email. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Don't forget to read comment #13. :)
Afaik the prefs sort alphabetically within the groups, so putting it right above OPACBaseURL would not be possible without renaming.
Okay, but you put it in a completely different section.
I have a few suggestions for this: 1) Use the Preference method of the Koha TT plugin instead of passing them in from the perl script. No real processing is done. 2) Change the new sys pref PublicCatalogUsesSSL to OpacProtocol and give it the two options with the values "http://" and "https://" instead of it being a yes/no. That way in the template we can use do [% Koha.Preference( 'OPACProtocol' ) %][% OPACBaseURL %] which will mean far fewer changes.
Hi Kyle, good suggestions, thank you for your review :) - I hope I will find some time to improve the patches.
I'll make the patches for you in a few hours, Katrin, if you would like.
Thx for the offer! I'd not be too unhappy if you took that item off my to do list :) Maybe leave a quick note here, when you get to it? So we don't try to fix it at the same time.
Actually, I've started on it, but it may take me another 9 hours before I finish, test, and post it up.
Comment on attachment 25878 [details] [review] [SIGNED OFF] Bug 5010: Send list emails with complete links back into the catalog Review of attachment 25878 [details] [review]: ----------------------------------------------------------------- ::: opac/opac-sendshelf.pl @@ -109,5 @@ > > - if (C4::Context->preference('OPACBaseURL')){ > - $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); > - } > - Unfortunately, koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc is affected by the removal: <link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL %]/cgi-bin/koha/unapi" />
Created attachment 27049 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new OPAC system preference, OpacProtocol, in the Policy subsection. It defaults to "doesn't use" (http://), but can be changed to "uses" (https://). basket/sendbasket.pl was tweaked for OpacProtocol changes. opac/opac-sendshelf.pl was returned to previous state, because it affects doc-head-close.inc if OPACBaseURL is not passed. This should be fixed to use the OpacProtocol system preference in another bug fix. virtualshelves/sendshelf.pl was returned to previous state, because the OpacProtocol logic is now in the virtualshelves/sendshelf.tt template file. TEST PLAN --------- 1) Back up your database 2) Drop your koha database and recreate it empty 3) In the mysql client: > SOURCE .../installer/data/mysql/sysprefs.sql; -- It should run without error. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 4) Restore your database 5) $ ./installer/data/mysql/updatedatabase.pl -- It should run the upgrade to insert OpacProtocol. 6) In the mysql client: > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 7) Log into the staff client 8) Click 'Koha administration' 9) Click 'Global system preferences' 10) Click the 'OPAC' tab on the left side. 11) Scroll down to the Policy section, and find the OpacProtocol preference. -- It should have a value of "doesn't use" in the drop down. 12) Fill your cart with something(s). 13) Make sure you have a list filled with something(s). 14) Click 'Cart' in the top menu bar area. 15) Click 'Send', and send it to yourself. 16) Click 'Close window' 17) Click 'Hide window' 18) Click 'More' and click 'Lists' 19) Choose a list and 'Send list' to yourself. 20) Check your email -- both emails should have OPAC URLs which start with http:// 21) Change the OPAC system preference OpacProtocol to 'uses' (https://), log out and log in (to force refresh of cached system preferences), and repeat steps 14 through 19. 22) Check your email -- the two new emails should have OPAC URLS which start with https:// NOTE: Other URLs may be broken as well, this bug only fixes carts and lists sent from staff.
Comment on attachment 27049 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client Review of attachment 27049 [details] [review]: ----------------------------------------------------------------- ::: basket/sendbasket.pl @@ +102,5 @@ > > + if (C4::Context->preference('OPACBaseURL')){ > + my $protocol = C4::Context->preference('OpacProtocol') // 'http://'; > + $template2->param( OPACBaseURL => $protocol . C4::Context->preference('OPACBaseURL') ); > + } koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt does not have OPACBaseURL in it. However, doc-head-close.inc does. This is a short-term fix, as the problem in doc-head-close.inc affects much more than just carts and lists. ::: koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt @@ +35,4 @@ > LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %] > URL : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %] > In the online catalog: > + [% Koha.Preference( 'OPACProtocol' ) %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] Took Kyle's second suggestion from comment #21. ::: opac/opac-sendshelf.pl @@ +109,5 @@ > > + if (C4::Context->preference('OPACBaseURL')){ > + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); > + } > + Oops. I think I let a bad piece in. ::: virtualshelves/sendshelf.pl @@ +103,2 @@ > if (C4::Context->preference('OPACBaseURL')){ > + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); This represents changing it back to what it was initially. @@ -104,2 @@ > if (C4::Context->preference('OPACBaseURL')){ > - $template2->param( OPACBaseURL => $protocol . C4::Context->preference('OPACBaseURL') ); The protocol logic is moved to the template now. Only need the OPACBaseURL, which is not available by default for staff client pages.
Comment on attachment 27049 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client Review of attachment 27049 [details] [review]: ----------------------------------------------------------------- ::: opac/opac-sendshelf.pl @@ +109,5 @@ > > + if (C4::Context->preference('OPACBaseURL')){ > + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); > + } > + Nope. Triple check shows this is what it was before. Removing probably does correct a problem, but it is unrelated to this bug (carts and lists in staff).
Created attachment 27072 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new OPAC system preference, OpacProtocol, in the Policy subsection. It defaults to "doesn't use" (http://), but can be changed to "uses" (https://). Both basket/sendbasket.pl and virtualshelves/sendshelf.pl were tweaked to always set OPACBaseURL. If OPACBaseURL is undef or not set, the URL is not given in the corresponding template files. opac/opac-sendshelf.pl was returned to previous state, because it affects doc-head-close.inc if OPACBaseURL is not passed. This should be fixed to use the OpacProtocol system preference in another bug fix. However, this is OPAC, not Staff, and outside of the bugs scope. Both basket/sendbasket.tt and virtualshelves/sendshelf.tt template files contain the suggested Koha.Preference logic recommended by Kyle in comment #21. TEST PLAN --------- 1) Back up your database 2) Drop your koha database and recreate it empty 3) In the mysql client: > SOURCE .../installer/data/mysql/sysprefs.sql; -- It should run without error. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 4) Restore your database 5) $ ./installer/data/mysql/updatedatabase.pl -- It should run the upgrade to insert OpacProtocol. 6) In the mysql client: > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 7) Log into the staff client 8) Click 'Koha administration' 9) Click 'Global system preferences' 10) Click the 'OPAC' tab on the left side. 11) Scroll down to the Policy section, and find the OpacProtocol preference. -- It should have a value of "doesn't use" in the drop down. 12) Fill your cart with something(s). 13) Make sure you have a list filled with something(s). 14) Click 'Cart' in the top menu bar area. 15) Click 'Send', and send it to yourself. 16) Click 'Close window' 17) Click 'Hide window' 18) Click 'More' and click 'Lists' 19) Choose a list and 'Send list' to yourself. 20) Check your email -- both emails should have OPAC URLs which start with http:// 21) Change the OPAC system preference OpacProtocol to 'uses' (https://), log out and log in (to force refresh of cached system preferences), and repeat steps 14 through 19. 22) Check your email -- the two new emails should have OPAC URLS which start with https:// NOTE: Other URLs may be broken as well, this bug only fixes carts and lists sent from staff.
Question: On opac-sendbasket.pl you send if (C4::Context->preference('OPACBaseURL')){ $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); } and in virtualshelves/sendshelf.tt [% Koha.Preference( 'OPACProtocol' ) %][% OPACBaseURL %]/cgi-bin/koha/opac... Why not [% Koha.Preference('OPACProtocol') %][% Koha.Preference('OPACBaseURL') %] ?
(In reply to Bernardo Gonzalez Kriegel from comment #31) > Question: > > On opac-sendbasket.pl you send > > if (C4::Context->preference('OPACBaseURL')){ > $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); > } > > and in virtualshelves/sendshelf.tt > > [% Koha.Preference( 'OPACProtocol' ) %][% OPACBaseURL %]/cgi-bin/koha/opac... > > Why not > > [% Koha.Preference('OPACProtocol') %][% Koha.Preference('OPACBaseURL') %] > > ? Because the include file requires OPACBaseURL defined for the opac ones: $ grep -l -i opacbaseurl `find . | grep en/.*inc$` ./koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc ./koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc ./koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc ./koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc ./koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc $ grep -i opacbaseurl ./koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc <link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL %]/cgi-bin/koha/unapi" /> This would explode into a wider scale fix required (lots more testing!). That's beyond the scope of this bug. I believe the second one has potential merit, but my goal was to minimize impact without having to look for other areas affected. I have found the OPACBaseURL logic was added by bug 6957, but I haven't looked much further. Since I was leaving OPACBaseURL intact to minimize potential impact, accessing the Template variable is likely faster than the Preference call and it is shorter to type, I didn't change that. The goal of this bug is to add OpacProtocol.
Patch 2/3 has fixable conflicts Patch 3/3 no, needs rebasing
Bug 11248 triggered the need for a rebase.
Created attachment 27431 [details] [review] Bug 5010: Send list emails with complete links back into the catalog This patch adapts the way the links in the cart email in OPAC are generated for the list emails. The OpacBaseURL variable is generated from code in Auth.pm. To test: - Create a list - Email yourself the list Note: Email is sent directly and not via messagequeue table - Verify the links back into the catalog are missing http(s):// - Apply the patch - Email yourself the list again - Verify the links are now ok and working Note: The way Auth.pm generates the OpacBaseURL is not correct, as it does not take into account the OpacBaseURL system preference. This patch makes both emails sent from OPAC rely on the same code and is an improvement over the current behaviour. Tested both together using steps similar to larger test plan. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 27432 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new system preference: PublicCatalogUsesSSL. To test: - Create a list - Send yourself the list from the staff interface - Verify that the links are http://<OPACBaseURL> - Put some records into your cart - Send yourself the cart from the staff interface - Verify that the links are missing http(s):// in front of them - Apply patch - Run database update - Verify that the default setting for PublicCatalogUsesSSL is 'doesn't use' - Resent both emails - Verfiy the catalog links are now both http:// links - Change system preference setting to 'uses' - Resent both emails - Verify the catalog links are now https:// links NOTE: My cart didn't have a 'In online catalog:' line on master. My list had http:// on master. System preference affected both cart and list sending. System preference necessary, because there is no way to determine http or https in the middle of an email. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: The rebase removed sendshelf.tt, because bug 11248 removed the hardcoded http:// in the template file. That may have been a mistake, since nothing was added to the corresponding sendshelf.pl file.
Created attachment 27433 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new OPAC system preference, OpacProtocol, in the Policy subsection. It defaults to "doesn't use" (http://), but can be changed to "uses" (https://). Both basket/sendbasket.pl and virtualshelves/sendshelf.pl were tweaked to always set OPACBaseURL. If OPACBaseURL is undef or not set, the URL is not given in the corresponding template files. opac/opac-sendshelf.pl was returned to previous state, because it affects doc-head-close.inc if OPACBaseURL is not passed. This should be fixed to use the OpacProtocol system preference in another bug fix. However, this is OPAC, not Staff, and outside of the bugs scope. Both basket/sendbasket.tt and virtualshelves/sendshelf.tt template files contain the suggested Koha.Preference logic recommended by Kyle in comment #21. TEST PLAN --------- 1) Back up your database 2) Drop your koha database and recreate it empty 3) In the mysql client: > SOURCE .../installer/data/mysql/sysprefs.sql; -- It should run without error. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 4) Restore your database 5) $ ./installer/data/mysql/updatedatabase.pl -- It should run the upgrade to insert OpacProtocol. 6) In the mysql client: > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 7) Log into the staff client 8) Click 'Koha administration' 9) Click 'Global system preferences' 10) Click the 'OPAC' tab on the left side. 11) Scroll down to the Policy section, and find the OpacProtocol preference. -- It should have a value of "doesn't use" in the drop down. 12) Fill your cart with something(s). 13) Make sure you have a list filled with something(s). 14) Click 'Cart' in the top menu bar area. 15) Click 'Send', and send it to yourself. 16) Click 'Close window' 17) Click 'Hide window' 18) Click 'More' and click 'Lists' 19) Choose a list and 'Send list' to yourself. 20) Check your email -- both emails should have OPAC URLs which start with http:// 21) Change the OPAC system preference OpacProtocol to 'uses' (https://), log out and log in (to force refresh of cached system preferences), and repeat steps 14 through 19. 22) Check your email -- the two new emails should have OPAC URLS which start with https:// NOTE: Other URLs may be broken as well, this bug only fixes carts and lists sent from staff.
Created attachment 27435 [details] [review] [SIGNED-OFF] Bug 5010: Send list emails with complete links back into the catalog This patch adapts the way the links in the cart email in OPAC are generated for the list emails. The OpacBaseURL variable is generated from code in Auth.pm. To test: - Create a list - Email yourself the list Note: Email is sent directly and not via messagequeue table - Verify the links back into the catalog are missing http(s):// - Apply the patch - Email yourself the list again - Verify the links are now ok and working Note: The way Auth.pm generates the OpacBaseURL is not correct, as it does not take into account the OpacBaseURL system preference. This patch makes both emails sent from OPAC rely on the same code and is an improvement over the current behaviour. Tested both together using steps similar to larger test plan. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Just add a sign.
Created attachment 27436 [details] [review] [SIGNED-OFF] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new system preference: PublicCatalogUsesSSL. To test: - Create a list - Send yourself the list from the staff interface - Verify that the links are http://<OPACBaseURL> - Put some records into your cart - Send yourself the cart from the staff interface - Verify that the links are missing http(s):// in front of them - Apply patch - Run database update - Verify that the default setting for PublicCatalogUsesSSL is 'doesn't use' - Resent both emails - Verfiy the catalog links are now both http:// links - Change system preference setting to 'uses' - Resent both emails - Verify the catalog links are now https:// links NOTE: My cart didn't have a 'In online catalog:' line on master. My list had http:// on master. System preference affected both cart and list sending. System preference necessary, because there is no way to determine http or https in the middle of an email. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: The rebase removed sendshelf.tt, because bug 11248 removed the hardcoded http:// in the template file. That may have been a mistake, since nothing was added to the corresponding sendshelf.pl file. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Add a sign
Created attachment 27437 [details] [review] [SIGNED-OFF] Bug 5010: (2) Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new OPAC system preference, OpacProtocol, in the Policy subsection. It defaults to "doesn't use" (http://), but can be changed to "uses" (https://). Both basket/sendbasket.pl and virtualshelves/sendshelf.pl were tweaked to always set OPACBaseURL. If OPACBaseURL is undef or not set, the URL is not given in the corresponding template files. opac/opac-sendshelf.pl was returned to previous state, because it affects doc-head-close.inc if OPACBaseURL is not passed. This should be fixed to use the OpacProtocol system preference in another bug fix. However, this is OPAC, not Staff, and outside of the bugs scope. Both basket/sendbasket.tt and virtualshelves/sendshelf.tt template files contain the suggested Koha.Preference logic recommended by Kyle in comment #21. TEST PLAN --------- 1) Back up your database 2) Drop your koha database and recreate it empty 3) In the mysql client: > SOURCE .../installer/data/mysql/sysprefs.sql; -- It should run without error. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 4) Restore your database 5) $ ./installer/data/mysql/updatedatabase.pl -- It should run the upgrade to insert OpacProtocol. 6) In the mysql client: > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 7) Log into the staff client 8) Click 'Koha administration' 9) Click 'Global system preferences' 10) Click the 'OPAC' tab on the left side. 11) Scroll down to the Policy section, and find the OpacProtocol preference. -- It should have a value of "doesn't use" in the drop down. 12) Fill your cart with something(s). 13) Make sure you have a list filled with something(s). 14) Click 'Cart' in the top menu bar area. 15) Click 'Send', and send it to yourself. 16) Click 'Close window' 17) Click 'Hide window' 18) Click 'More' and click 'Lists' 19) Choose a list and 'Send list' to yourself. 20) Check your email -- both emails should have OPAC URLs which start with http:// 21) Change the OPAC system preference OpacProtocol to 'uses' (https://), log out and log in (to force refresh of cached system preferences), and repeat steps 14 through 19. 22) Check your email -- the two new emails should have OPAC URLS which start with https:// NOTE: Other URLs may be broken as well, this bug only fixes carts and lists sent from staff. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, shelf and cart. No koha-qa errors
Created attachment 27673 [details] [review] Bug 5010 - Follow up: Case typographical error The call had 'OPACProtocol', but it should be 'OpacProtocol'. I am uncertain why it functioned. TEST PLAN --------- 1) Retest the sending cart from staff client. NOTE: Last patch needed sign off.
Marking as a candidate for 3.16.0. Not a guarantee, however.
Created attachment 27779 [details] [review] [SIGNED-OFF] Bug 5010 - Follow up: Case typographical error The call had 'OPACProtocol', but it should be 'OpacProtocol'. I am uncertain why it functioned. TEST PLAN --------- 1) Retest the sending cart from staff client. Sign comment: It works because mysql is case insensitive :) (try "select variable from systempreferences where variable like 'opac%'") Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No koha-qa errors
Solved small conflicts on updatedatabse.pl, but only upload last patch signed.
2 questions: 1/ Shouldn't we use this pref wherever OPACBaseURL is used? 2/ Shouldn't we put a warning in the updatedb entry?
I think the problem mostly is where we try to build the URL in staff, because there you can't get the information if the OPAC is run as https. There are other options used for links in the OPAC. Maybe this could be a first step?
This is a first step. We fix one place, and if this is deemed sufficient, we go on to the rest. Ideally, this could be integrated into a function that will get used everywhere. Yes, it would be a good idea to put a warning: "If you use HTTPS for your OPAC, then please set OpacProtocol to 'use' in the OPAC system preferences' Policy section." However, I don't have time to add that.
I won't be including this in 3.16.0, as I think it needs to bake for a bit longer: - do we /really/ need a new system preference when we could enforce making OPACBaseURL contain the protocol? - is it clear that somebody email a cart from the staff interface wants the results to point to the OPAC, rather than the staff interface?
(In reply to Galen Charlton from comment #48) > - do we /really/ need a new system preference when we could enforce making > OPACBaseURL contain the protocol? Valid point. Just that if one only wants to fix a tiny piece at a time, this solution works. Enforcing the protocol is a much larger patch. > - is it clear that somebody email a cart from the staff interface wants the > results to point to the OPAC, rather than the staff interface? One could email it to someone without staff access. I think it is best to email OPAC links, and not staff links. That is, I think the current behaviour is best. Now, that doesn't mean that they won't want the staff interface link, but since we do not know if the email address has staff access (we don't check, though I suppose we could), OPAC is quickest solution. Perhaps a logged in user should have the staff URL in their OPAC details pages, if they have access?
Created attachment 27951 [details] [review] Bug 5010: Send list emails with complete links back into the catalog This patch adapts the way the links in the cart email in OPAC are generated for the list emails. The OpacBaseURL variable is generated from code in Auth.pm. To test: - Create a list - Email yourself the list Note: Email is sent directly and not via messagequeue table - Verify the links back into the catalog are missing http(s):// - Apply the patch - Email yourself the list again - Verify the links are now ok and working Note: The way Auth.pm generates the OpacBaseURL is not correct, as it does not take into account the OpacBaseURL system preference. This patch makes both emails sent from OPAC rely on the same code and is an improvement over the current behaviour. Tested both together using steps similar to larger test plan. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Just add a sign.
Created attachment 27952 [details] [review] Bug 5010: Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new system preference: PublicCatalogUsesSSL. To test: - Create a list - Send yourself the list from the staff interface - Verify that the links are http://<OPACBaseURL> - Put some records into your cart - Send yourself the cart from the staff interface - Verify that the links are missing http(s):// in front of them - Apply patch - Run database update - Verify that the default setting for PublicCatalogUsesSSL is 'doesn't use' - Resent both emails - Verfiy the catalog links are now both http:// links - Change system preference setting to 'uses' - Resent both emails - Verify the catalog links are now https:// links NOTE: My cart didn't have a 'In online catalog:' line on master. My list had http:// on master. System preference affected both cart and list sending. System preference necessary, because there is no way to determine http or https in the middle of an email. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: The rebase removed sendshelf.tt, because bug 11248 removed the hardcoded http:// in the template file. That may have been a mistake, since nothing was added to the corresponding sendshelf.pl file. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Add a sign
Created attachment 27953 [details] [review] Bug 5010: (2) Fix incomplete links in carts and lists sent from the staff client While the list email hardcoded http:// in front of the URL, the cart email was missing http(s)://. As there seems to be no reliable way to determine in staff if the OPAC is using SSL or not, this patch introduces a new OPAC system preference, OpacProtocol, in the Policy subsection. It defaults to "doesn't use" (http://), but can be changed to "uses" (https://). Both basket/sendbasket.pl and virtualshelves/sendshelf.pl were tweaked to always set OPACBaseURL. If OPACBaseURL is undef or not set, the URL is not given in the corresponding template files. opac/opac-sendshelf.pl was returned to previous state, because it affects doc-head-close.inc if OPACBaseURL is not passed. This should be fixed to use the OpacProtocol system preference in another bug fix. However, this is OPAC, not Staff, and outside of the bugs scope. Both basket/sendbasket.tt and virtualshelves/sendshelf.tt template files contain the suggested Koha.Preference logic recommended by Kyle in comment #21. TEST PLAN --------- 1) Back up your database 2) Drop your koha database and recreate it empty 3) In the mysql client: > SOURCE .../installer/data/mysql/sysprefs.sql; -- It should run without error. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 4) Restore your database 5) $ ./installer/data/mysql/updatedatabase.pl -- It should run the upgrade to insert OpacProtocol. 6) In the mysql client: > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' 7) Log into the staff client 8) Click 'Koha administration' 9) Click 'Global system preferences' 10) Click the 'OPAC' tab on the left side. 11) Scroll down to the Policy section, and find the OpacProtocol preference. -- It should have a value of "doesn't use" in the drop down. 12) Fill your cart with something(s). 13) Make sure you have a list filled with something(s). 14) Click 'Cart' in the top menu bar area. 15) Click 'Send', and send it to yourself. 16) Click 'Close window' 17) Click 'Hide window' 18) Click 'More' and click 'Lists' 19) Choose a list and 'Send list' to yourself. 20) Check your email -- both emails should have OPAC URLs which start with http:// 21) Change the OPAC system preference OpacProtocol to 'uses' (https://), log out and log in (to force refresh of cached system preferences), and repeat steps 14 through 19. 22) Check your email -- the two new emails should have OPAC URLS which start with https:// NOTE: Other URLs may be broken as well, this bug only fixes carts and lists sent from staff. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, shelf and cart. No koha-qa errors
Created attachment 27954 [details] [review] Bug 5010 - Follow up: Case typographical error The call had 'OPACProtocol', but it should be 'OpacProtocol'. I am uncertain why it functioned. TEST PLAN --------- 1) Retest the sending cart from staff client. Sign comment: It works because mysql is case insensitive :) (try "select variable from systempreferences where variable like 'opac%'") Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No koha-qa errors
I have rebased, but the discussion on comment 48 and comment 49 should continue. Also, Katrin, I've bounced this back to you, as my development time available for Koha has drastically reduced.
I would favor resolving this issue via OPACBaseURL and not create a new preference that only tells you about the protocol. The protocol should just be in OPACBaseURL. Smart code could assume that it is HTTP if this pref does not start with a protocol. Changing status to In Discussion
Maybe we could take a step by step approach here? Currently we are sending out incomplete emails and making the way we create the links consistent, will take a lot more work. We have code in Auth.pm that produces working links for the opac cart email, but doesn't use OpacBaseUrl. And the links in the opac list emails are broken. The first patch was just trying to copy the logic from the cart email for the opac list email, so both would create the links the same way using the same lines of code. Maybe this could be still be a valid first step?
(In reply to Katrin Fischer from comment #56) > Maybe we could take a step by step approach here? > > Currently we are sending out incomplete emails and making the way we create > the links consistent, will take a lot more work. > > We have code in Auth.pm that produces working links for the opac cart email, > but doesn't use OpacBaseUrl. And the links in the opac list emails are > broken. > > The first patch was just trying to copy the logic from the cart email for > the opac list email, so both would create the links the same way using the > same lines of code. Maybe this could be still be a valid first step? I would not mind passing QA on the first patch, overriding opacbaseurl with the stuff from Auth.pm as a temporary measure. (Maybe adding a comment somewhere?) But the lines in Auth.pm: OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"), should actually be adjusted when resolving the various OpacBaseURL bugs. Note that there was an issue too with the https function and Plack..
I totally agree that we need to figure out a proper way to generate the URLs that works in the various possible situations. I'd also not mind if we changed the code in Auth.pm - I think in the OPAC it should be possible to determine if https is being used. Maybe ist would be best to split off the OPAC problem into a separate bug now?
(In reply to Katrin Fischer from comment #58) > I totally agree that we need to figure out a proper way to generate the URLs > that works in the various possible situations. I'd also not mind if we > changed the code in Auth.pm - I think in the OPAC it should be possible to > determine if https is being used. > > Maybe ist would be best to split off the OPAC problem into a separate bug > now? Looking forward to your proposal..
I am not sure I will be able to provide an idea for the final solution, but I can try and split out a bug for the OPAC change - but probably won't be today.
(In reply to M. de Rooy from comment #57) > But the lines in Auth.pm: > OPACBaseURL => ($in->{'query'}->https() ? > "https://" : "http://") . $ENV{'SERVER_NAME'} . > ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" > : "80") ? '' : ":$ENV{'SERVER_PORT'}"), > > should actually be adjusted when resolving the various OpacBaseURL bugs. > Note that there was an issue too with the https function and Plack.. One could run their staff and OPAC clients on different ports. I'm not saying every combination is sane, but every combination is not accounted for with that code. This code does not account for the sane combination of https (staff) and http (OPAC), nor the strange combination of http (staff) and https (OPAC). The best way, without the OpacProtocol system preference, is a full-out across the board fix the hard coded 'http' 'https' messes, and require the protocol in OPACBaseURL. The problem with this solution is that it is much larger to implement, because if you put http(s) into your OPACBaseURL, you'll get http://http(s):// in locations you haven't fixed yet. If Katrin can fix all the OPACBaseURLs, that would be great. :)
(In reply to M. Tompsett from comment #61) > One could run their staff and OPAC clients on different ports. I'm not > saying every combination is sane, but every combination is not accounted for > with that code. This code does not account for the sane combination of https > (staff) and http (OPAC), nor the strange combination of http (staff) and > https (OPAC). I think that she wants to concentrate first on fixing the opac side of this problem: so only opac-sendshelf. In that case the protocol will hopefully be correct in most cases. Sending a wrong shelf list from staff may be a much smaller issue.. > The best way, without the OpacProtocol system preference, is a full-out > across the board fix the hard coded 'http' 'https' messes, and require the > protocol in OPACBaseURL. Agreed. Like "adjust when resolving the various OpacBaseURL bugs"..
Marcel is right, I was offering to try the 'cheaper' solution, as I probably won't have time for the bigger fix. I think the suggested solution to include the protocol sounds good.
It's worth noting that bug 11575 has been pushed to master, so that might affect this bug. The "OpacProtocol" system preference is probably a good idea. Heck, that might remove the need to do more fancy checking for HTTPS when using reverse proxies and/or Plack.
Also should be noted a minor rebase is required before fixing. I think it would be optimal if all the OPACBaseURLs passed to the templates were full paths including the https or http accordingly. I am not so sure I think the OpacProtocol system preference idea is the best way to do it, but rather it should be in the OPACBaseURL system preference itself. We shouldn't be hardcoding http or https anywhere. We shouldn't need to check for http or https anywhere. I feel the best solution is the most painful to do: fix every instance of OPACBaseURL use or hardcoded protocols to just use the OPACBaseURL. However, once done, it will just work. That is the way Koha should work. Sadly, there are partial links in some of the included header templates which would cascade to a larger than simpler solution, as far as I recall from last time I checked. Honestly, someone needs to bite the bullet. I don't have time.
While I got distracted, Robin wrote a patch to fix the list email in OPAC - but we still need the real once and for all solution.
Okay, okay. When I finally get around to upgrading our system, I'll take a whack at changing everything to expect the protocol in the OPACBaseURL, like it should be. So, unless someone beats me to it, I'll get on it.
(In reply to M. Tompsett from comment #67) > Okay, okay. When I finally get around to upgrading our system, I'll take a > whack at changing everything to expect the protocol in the OPACBaseURL, like > it should be. So, unless someone beats me to it, I'll get on it. That is the way to do it, imo. There's technically no reason you couldn't have your opac at gopher://example.com, and it'd be good to handle that sort of craziness. Most things shouldn't require any changes, as they already expect that Auth.pm will attach the http(s) to the start anyway.
Scope broadened from the original, "Incomplete links in carts and lists sent from the staff client"
Created attachment 31727 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. TEST PLAN --------- Not done yet
Created attachment 31728 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. TEST PLAN --------- Not done yet
Created attachment 31729 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. TEST PLAN --------- Not done yet
Created attachment 31787 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. 39) Run koha qa test
The _get_uri function will need to be amended in bug 8446, if this passes first, or a patch added afterwards if passes later.
(In reply to M. Tompsett from comment #74) > The _get_uri function will need to be amended in bug 8446, if this passes > first, or a patch added afterwards if passes later. So an additional patch is required here?
(In reply to Owen Leonard from comment #75) > So an additional patch is required here? Yes, an additional patch is required here. I'm working on it.
Created attachment 33726 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :(
Follow the test plan in comment #77. Though, I do hope to post instructions on how to install Test::DBIx::Class in Debian Jessie (yes, I said Jessie) for full testing.
Created attachment 35662 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased...
Created attachment 35760 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again...
Created attachment 35833 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox...
Created attachment 35847 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox... Also fixed missing sample notices.
Created attachment 35852 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox... Fixed from who...
Created attachment 35853 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox...
Created attachment 35854 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox...
Created attachment 36177 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol
Last patch fixed an easy conflict on updatedatabase.pl
*** Bug 7770 has been marked as a duplicate of this bug. ***
Created attachment 37695 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again not on kohadevbox... while trying to test 6874.
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging installer/data/mysql/sysprefs.sql Auto-merging catalogue/detail.pl Failed to merge in the changes. Patch failed at 0001 Bug 5010 - Fix OPACBaseURL to include protocol
Created attachment 38128 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox...
Created attachment 38658 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 38659 [details] [review] Bug 5010: Fix - replace tab with spaces Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signing off but it needs another one, I did not really follow the test plan.
Created attachment 38833 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 38834 [details] [review] Bug 5010: Fix - replace tab with spaces Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 39008 [details] [review] Bug 5010 - Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 39009 [details] [review] Bug 5010: Fix - replace tab with spaces Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 39086 [details] [review] [SIGNED-OFF] Bug 5010: Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39087 [details] [review] [SIGNED-OFF] Bug 5010: Fix - replace tab with spaces Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No errors. Tested what I can, not plack/shibboleth/cas Perhaps this can pass and we can fix any problem later (for 3.22)
(In reply to Bernardo Gonzalez Kriegel from comment #100) > Tested what I can, not plack/shibboleth/cas For plack: https://github.com/digibib/kohadevbox (Because I don't understand how to get it installed by default either) For shibboleth: I figure the tests are good enough, but you need Test::DBIx::Class (which I believe is in the kohadevbox :) ) For cas: Again, I just assumed the tests were good enough. > Perhaps this can pass and we can fix any problem later (for 3.22) Yes, please. :)
(In reply to M. Tompsett from comment #101) > For shibboleth: I figure the tests are good enough, but you need > Test::DBIx::Class (which I believe is in the kohadevbox :) ) Debug and make sense of this to get it in. sudo apt-get install dh-make-perl libdata-visitor-perl libdbix-class-timestamp-perl libdatetime-format-sqlite-perl libdatetimex-easy-perl libtype-tiny-perl libyaml-tiny-perl libmoox-handlesvia-perl libtest-fatal-perl libclass-dbi-perl libmoosex-types-path-class-perl libmoosex-types-json-perl libmoosex-types-loadableclass-perl libtime-piece-mysql-perl libmath-base36-perl libcpanel-json-xs-perl libclass-accessor-lite-perl libfile-copy-recursive-perl libtest-sharedfork-perl libtest-deep-perl libdata-uuid-perl libdbix-class-uuidcolumns-perl libtest-differences-perl libdbd-mysql mysql-server libdatetime-format-mysql-perl cpan2deb MooseX::Attribute::ENV cpan2deb DBD::SQLite cpan2deb MooX::HandlesVia cpan2deb DBIx::Class::Schema::PopulateMore cpan2deb Test::mysqld cpan2deb Test::DBIx::Class
I may have gotten the Depends on direction wrong for the: prove t/Auth_with_shibboleth.t I retested all this yesterday on the kohadev box. I ended up making the same sorts of changes that are in bug 14111 in order for it to pass the t/Auth_with_shibboleth.t tests.
(In reply to M. Tompsett from comment #103) > I ended up making the same sorts of changes that are in bug 14111 in order > for it to pass the t/Auth_with_shibboleth.t tests. Specifically, I applied the second patch of bug 14111 in order to ensure prove t/Auth_with_shibboleth.t did not fail.
Created attachment 39358 [details] [review] Bug 5010: Fix OPACBaseURL to include protocol First, it is strongly recommended to set the OPACBaseURL. But this patch allows the inclusion of the protocol and not just a site. Next, C4/Auth now puts OPACBaseURL into the template parameters regardless of OPAC or Staff clients. t/db_dependent/Auth.t was tweaked to add a check for confirming that get_template_and_user adds OPACBaseURL to both OPAC and Staff templates. In the staff client, once the OPACBaseURL is set, you get a nice OPAC View link when viewing a biblio's detail. It should reflect the protocol used now. Hard coded 'http://' strings were removed from the sample_notices.sql files. This is what required also updating the letters table in the updatedatabase.pl script. The explanation text in the sysprefs.sql needed updating too to reflect the inclusion of the protocol. And this was the other update done in the updatedatabase.pl script. The opac.pref file was similarly changed as well. catalogue/detail.pl had no need to pass a custom OpacUrl value, since C4/Auth passes the required OPACBaseURL, so it and the corresponding template were modified. Both the MARC21 and NORMARC intranet details files had 'http://' hard coded in them. This was removed. Both the bootstrap and prog theme opac-detail template had a protocol parameter that was used. The logic for the parameter was not removed, because it is used extensively in one template. Perhaps it should be used to simplify the other. However, the calculated current_url parameter had references to the protocol removed, because of the changes to OPACBaseURL. opac/opac-shareshelf.pl had a hard coded 'http://' which was removed. t/db_dependent/Auth_with_cas.t had 'http://' added to the value set for OPACBaseURL. In virtualshelves/sendshelf.pl explicit code which sent the OPACBaseURL preference was removed, since C4/Auth sends it all the time now. C4::Context::set_preference was tweaked to ensure that OPACBaseURL would always start with http. t/db_dependent/Context.t was tweaked to specifically test this. The Shibboleth authentication needs OPACBaseURL set, and that it be https protocol. The _get_uri routine was tweaked to always pass back https:// as the protocol on the OPACBaseURL. t/Auth_with_shibboleth.t was tweaked to specifically test the changes. TEST PLAN --------- This is not an easy patch to test. Difficulties include: - 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. UPDATEDATABASE 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 "%<<OPACBaseURL>>%"; -- There should be no prepended http:// on the <<OPACBaseURL>>. 7) restore your DB 8) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. AUTH 9) Call up staff client. 10) Call up OPAC. -- C4/Auth.pm doesn't barf. 11) Call up Plack staff client 12) Call up Plack OPAC. -- C4/Auth.pm doesn't barf. 13) prove -v t/db_dependent/Auth.t CONTEXT 14) Home -> Koha administration -> Global System Preferences -> OPAC 15) Modify and save OPACBaseURL to not have http:// or https:// on it. -- It should be modified to include http:// 16) Modify and save another system preference. -- It should save normally 17) prove -v t/db_dependent/Context.t CATALOGUE/DETAIL (tt & pl) 18) Confirm the OPACBaseURL is set 19) Navigate to any biblio details in the staff client -- There should be a "OPAC view" link which has the correct http:// or https:// in it. SQL (sample notices and sysprefs) 20) Run the mysqlclient from your koha git directory USE koha_library; DELETE FROM letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/en/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/it-IT/necessari/notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; DELETE FROM letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql; SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%"; -- Each of the selects should should lines that have <<OPACBaseURL>> 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 21) restore your DB 22) Make sure OPACBaseURL is set with the protocol included, preferably https. -- Using https requires a bunch of apache2 tweaks. SLIM2INTRANETDETAIL 23) Set 'XSLTDetailsDisplay' system preference to default. 24) Set 'marcflavour' system preference to MARC21. 25) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// 26) Set 'marcflavour' system preference to NORMARC. 27) View any biblio's details. -- the URL beside 'OPAC View' should have the appropriate http:// or https:// OPAC-DETAIL 28) Set 'opacthemes' to bootstrap. 29) Set 'SocialNetworks' to enabled. 30) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. 31) Set 'opacthemes' to prog. 32) In OPAC, view any biblio's details. -- the Share links should have the appropriate protocol on the OPACBaseURL. AUTH_WITH_CAS 33) prove -v t/db_dependent/Auth_with_cas.t OPAC-SHARESHELF 34) Set 'OpacAllowSharingPrivateLists' to allow. 35) In OPAC, 'Save to Lists' a search result. 36) Save it to a new private list. 37) Click the Lists button, and select the new list. 38) Click the Share button. AUTH_WITH_SHIBBOLETH 39) prove -v t/Auth_with_shibboleth.t -- needs to be tests on Debian, because I can't get the Test::DBIx::Class installed in Ubuntu. :( Rebased again on kohadevbox... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 39359 [details] [review] Bug 5010: Fix - replace tab with spaces Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No errors. Tested what I can, not plack/shibboleth/cas Perhaps this can pass and we can fix any problem later (for 3.22) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
QA Comment: Great work, Mark. This took some time :) Code looks good to me. No complaints from qa tools. I understood that Martin tested the shibboleth case. I did not test cas or plack. Altough I do not expect something there when looking at the code, I leave it to RM to request additional tests. A very early push of this patch in 3.22 could perhaps resolve that btw.. Some small remarks: + if ($oldprotocol ne 'https') { + $debug + and warn + 'Shibboleth requires OPACBaseURL to use the https protocol!'; + } Perhaps we could argue here that the debug flag is not needed. Just warn. C4/Context.pm: + # force explicit protocol on OPACBaseURL + if ($var eq 'opacbaseurl' && substr($value,0,4) !~ /http/) { + $value = 'http://' . $value; + } This is bit more of a philosophical nature: Should we enforce it and make users lazy? Or should we enforce it differently: Perhaps with a select combo with protocol? Or in javascript? Note that if you now save the pref, you still have a wrong value. Should we depend on modules to correct pref values? I would be more in favor of correcting it earlier in the process. (No blocker) What about staffClientBaseURL now? :-) svc/import_bib: my $url = 'http://'. C4::Context->preference('staffClientBaseURL') .'/cgi-bin/koha/catalogue/detail.pl?biblionumber='. $biblionumber; [This pref seems to be the easier case.] Passed QA
Additionally: I git grepped on several case combinations of OPACBaseUrl and found this exception: t/db_dependent/Auth_with_cas.t contains OpacBaseURL (NOK) misc/release_notes/release_notes_3_10_0.txt contains OPACBaseurl (OK) No big deal, noted for the record..
Patches pushed to master. Thanks Mark and everyone involved in QA, this one has been a big effort for everyone involved!
(In reply to Tomás Cohen Arazi from comment #109) > Patches pushed to master. > > Thanks Mark and everyone involved in QA, this one has been a big effort for > everyone involved! *whew* with Bug 13967 getting pushed, I was worried I'd need to rebase this. :)
Pushed to 3.20.x will be in 3.20.1
Hi, This patch does not apply cleanly to 3.18.x, if you feel it should be included, please rebase for 3.18.x. Cheers, Liz
*** Bug 6146 has been marked as a duplicate of this bug. ***