Summary: | Internal server error because of missing currency | ||
---|---|---|---|
Product: | Koha | Reporter: | Michael Kuhn <mik> |
Component: | Acquisitions | Assignee: | Marc Véron <veron> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | david.bourgault, jonathan.druart, philippe.blouin, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 15084 | ||
Bug Blocks: | |||
Attachments: |
Bug 19328 - Internal server error because of missing currency
Bug 19328 - Internal server error because of missing currency Bug 19328 - Internal server error because of missing currency |
Description
Michael Kuhn
2017-09-15 21:15:52 UTC
Confirmed on current master. Created attachment 67179 [details] [review] Bug 19328 - Internal server error because of missing currency This patch fixes internal server errors because of missing active currency in files aqbudgetperiods.pl, aqbudgets.pl and aqplan.pl. To reproduce: - Make sure that no active currency is defined. You can undefine the active currency in Administration->Currencies and exchange rates - Try to go to Administration->Budgets and Admistration->Funds Result: Internal server error To test: - Apply patch - Restart plack - Try to reproduce issue, it should no longer occur. There should be a yellow message box "No active currency is defined" - From Administration-> Budgets administration try to edit a fund and go to "Planning". Verify that the message box appears here as well. Seems to be a regression. Oh, there are more candidates for Internal server errors, maybe to be investigated / fixed in a separate bug: git grep 'Currencies->get_active' C4/Biblio.pm: my $active_currency = Koha::Acquisition::Currencies->get_active; C4/Overdues.pm: my $active_currency = Koha::Acquisition::Currencies->get_active; Koha/Number/Price.pm: my $currency = Koha::Acquisition::Currencies->get_active; about.pl:my $warnNoActiveCurrency = (! defined Koha::Acquisition::Currencies->get_active); acqui/acqui-home.pl:my $cur = Koha::Acquisition::Currencies->get_active; acqui/addorder.pl: my $currency = Koha::Acquisition::Currencies->get_active; acqui/addorderiso2709.pl: my $active_currency = Koha::Acquisition::Currencies->get_active; acqui/basket.pl: my $active_currency = Koha::Acquisition::Currencies->get_active; acqui/invoice.pl: currency => Koha::Acquisition::Currencies->get_active, acqui/neworderempty.pl:my $active_currency = Koha::Acquisition::Currencies->get_active; admin/aqbudgetperiods.pl:my $active_currency = Koha::Acquisition::Currencies->get_active; admin/aqbudgets.pl:my $active_currency = Koha::Acquisition::Currencies->get_active; admin/aqplan.pl:my $active_currency = Koha::Acquisition::Currencies->get_active; admin/preferences.pl: my $active_currency = Koha::Acquisition::Currencies->get_active; opac/opac-account-pay-paypal-return.pl:my $active_currency = Koha::Acquisition::Currencies->get_active; opac/opac-account-pay.pl:my $active_currency = Koha::Acquisition::Currencies->get_active; opac/sco/sco-main.pl:if ( my $active_currency = Koha::Acquisition::Currencies->get_active ) { t/db_dependent/Koha/Acquisition/Currencies.t:my $active_currency = Koha::Acquisition::Currencies->get_active; t/db_dependent/MungeMarcPrice.t:my $active_currency = Koha::Acquisition::Currencies->get_active; Created attachment 67321 [details] [review] Bug 19328 - Internal server error because of missing currency This patch fixes internal server errors because of missing active currency in files aqbudgetperiods.pl, aqbudgets.pl and aqplan.pl. To reproduce: - Make sure that no active currency is defined. You can undefine the active currency in Administration->Currencies and exchange rates - Try to go to Administration->Budgets and Admistration->Funds Result: Internal server error To test: - Apply patch - Restart plack - Try to reproduce issue, it should no longer occur. There should be a yellow message box "No active currency is defined" - From Administration-> Budgets administration try to edit a fund and go to "Planning". Verify that the message box appears here as well. Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Created attachment 67922 [details] [review] Bug 19328 - Internal server error because of missing currency This patch fixes internal server errors because of missing active currency in files aqbudgetperiods.pl, aqbudgets.pl and aqplan.pl. To reproduce: - Make sure that no active currency is defined. You can undefine the active currency in Administration->Currencies and exchange rates - Try to go to Administration->Budgets and Admistration->Funds Result: Internal server error To test: - Apply patch - Restart plack - Try to reproduce issue, it should no longer occur. There should be a yellow message box "No active currency is defined" - From Administration-> Budgets administration try to edit a fund and go to "Planning". Verify that the message box appears here as well. Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> I am willing to push this patch but I do not think it is the way to fix it. Please do not fix more occurrences. Pushed to master for 17.11, thanks to everybody involved! |