Bug 27246

Summary: Remove apache only code from C4::Context BEGIN
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, fridolin.somers, jcamins, martin.renvoize, nick, tomascohen, victor
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8389
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:
Attachments: Bug 27246: Remove obsolete BEGIN code from C4::Context
Bug 27246: Remove obsolete BEGIN code from C4::Context
Bug 27246: Remove obsolete BEGIN code from C4::Context

Description Jonathan Druart 2020-12-16 10:04:41 UTC

    
Comment 1 Jonathan Druart 2020-12-16 10:10:29 UTC
Created attachment 114431 [details] [review]
Bug 27246: Remove obsolete BEGIN code from C4::Context

We don't longer enter the HTTP_USER_AGENT conditional in the BEGIN block
of C4::Context. It was used when apache only was used.

I am suggesting to remove it but keep the $CGI::VERSION < 4.08 condition
to keep support of all version (not sure it's needed but won't hurt).

I have not found a lot of occurrences of KOHA_BACKTRACES and I am
assuming not much people are using it, we should prefer the dev_install
flag instead (to set environment="development" when plack is started and
enabled the starman trace)

Test plan:
Regression test what you think is useful
Confirm the above statements
Comment 2 Jonathan Druart 2020-12-16 10:12:17 UTC
*** Bug 8389 has been marked as a duplicate of this bug. ***
Comment 3 Victor Grousset/tuxayo 2021-04-28 04:36:31 UTC
Not worth a signoff but here is some random testing:

applied patch
restarted services (in koha-testing-docker)
ran the GUI tests: prove -r t/db_dependent/selenium/
went to OPAC
went to staff interface
did a checkout, showed it in the patrons page (to test the related API call)

restarted koha-testing-docker to see an eventual difference compared to  applying when already started
Comment 4 David Cook 2021-04-28 04:59:29 UTC
Thumbs up for removing all that stuff
Comment 5 Victor Grousset/tuxayo 2021-04-29 16:15:50 UTC
dcook, any hint of what I should test?
Comment 6 David Cook 2021-04-29 23:07:51 UTC
(In reply to Victor Grousset/tuxayo from comment #5)
> dcook, any hint of what I should test?

Honestly, I don't think that functionality has worked in a long time if ever. There's not really much to test except making sure that no typo was introduced, so just loading Koha is probably sufficient. Making sure C4::Context compiles.
Comment 7 Victor Grousset/tuxayo 2021-04-30 15:26:04 UTC
Created attachment 120346 [details] [review]
Bug 27246: Remove obsolete BEGIN code from C4::Context

We don't longer enter the HTTP_USER_AGENT conditional in the BEGIN block
of C4::Context. It was used when apache only was used.

I am suggesting to remove it but keep the $CGI::VERSION < 4.08 condition
to keep support of all version (not sure it's needed but won't hurt).

I have not found a lot of occurrences of KOHA_BACKTRACES and I am
assuming not much people are using it, we should prefer the dev_install
flag instead (to set environment="development" when plack is started and
enabled the starman trace)

Test plan:
Regression test what you think is useful
Confirm the above statements

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 8 Victor Grousset/tuxayo 2021-04-30 15:26:56 UTC
Then we can sign it off :) Including David in it for the analysis ^^
Comment 9 Martin Renvoize (ashimema) 2021-05-04 10:48:33 UTC
Created attachment 120436 [details] [review]
Bug 27246: Remove obsolete BEGIN code from C4::Context

We don't longer enter the HTTP_USER_AGENT conditional in the BEGIN block
of C4::Context. It was used when apache only was used.

I am suggesting to remove it but keep the $CGI::VERSION < 4.08 condition
to keep support of all version (not sure it's needed but won't hurt).

I have not found a lot of occurrences of KOHA_BACKTRACES and I am
assuming not much people are using it, we should prefer the dev_install
flag instead (to set environment="development" when plack is started and
enabled the starman trace)

Test plan:
Regression test what you think is useful
Confirm the above statements

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2021-05-04 10:49:39 UTC
Nice bit of cleanup, no regressions spotted and I agree with David's conclusion that I don't think it's been used for quite some time.

Passing QA
Comment 11 Jonathan Druart 2021-05-04 13:24:34 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 12 Fridolin Somers 2021-05-11 12:08:24 UTC
Enhancement not pushed to 20.11.x