Koha/admin
Julian Maurice 4b65d099d7 Bug 28276: Do not fetch config ($KOHA_CONF) from memcached
memcached address and namespace are in $KOHA_CONF, so it is required to
read it before being able to access the cache. And after that,
configuration is kept in memory forever. Storing this in memcached is
useless and even counter-productive, since Koha reads both the file and
the cache

This patch addresses this issue by removing the cache-related code from
C4::Context->new.
It means that C4::Context->new will always read the configuration file,
so this patch also replaces inappropriate calls to
C4::Context->new->config by appropriate calls to C4::Context->config

It also fixes a bug where C4::Context->new would ignore the filepath
given in parameters if there was something in cache.

It also removes a problematic call to Koha::Caches->get_instance.
Because this call was outside of any subroutine, it would have happened
before the initialization of $C4::Context::context (which happen in
C4::Context::import)

Test plan:
1. Do not apply the patch yet
2. Add the following line at the beginning of Koha::Config::read_from_file
    warn "read_from_file($file)";
   This will allow you to check how many times the file is read.
3. Flush memcached and restart starman
4. Check the logs, you should see "read_from_file" a bunch of times
5. Apply the patch
6. Re-add the line from step 2
7. Flush memcached and restart starman
8. Check the logs, you should see "read_from_file" only once
9. Make sure the memcached config from $KOHA_CONF (memcached_servers,
   memcached_namespace) is taken into account by checking the About page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-05-10 10:28:04 +02:00
..
searchengine/elasticsearch Bug 26051: Add sort=1 on cn-sort in mappings.yaml 2021-02-23 13:12:56 +01:00
add_user_search.pl Bug 23271: Replace search_limited with search_with_library_limits 2021-04-21 15:25:07 +02:00
additional-fields.pl
admin-home.pl
adveditorshortcuts.pl
aqbudgetperiods.pl
aqbudgets.pl
aqcontract.pl
aqplan.pl
audio_alerts.pl
auth_subfields_structure.pl Bug 8976: Use existing Koha::Authority::Subfield[s] 2021-03-03 11:57:51 +01:00
auth_tag_structure.pl
authorised_values.pl
authtypes.pl
background_jobs.pl
biblio_framework.pl
branch_transfer_limits.pl
branches.pl
cash_registers.pl
categories.pl Bug 23271: Use Koha::Object::Limit::Library for Koha::Patron::Categories 2021-04-21 15:25:07 +02:00
check_budget_parent.pl
check_parent_total.pl
checkmarc.pl
cities.pl
classsources.pl
clone-rules.pl
columns_settings.pl Bug 27673: Replace YAML with YAML::XS 2021-02-16 14:54:50 +01:00
columns_settings.yml Bug 27790: Add the new column to columns_settings.yml 2021-04-27 16:23:49 +02:00
credit_types.pl
currency.pl
debit_types.pl
desks.pl
didyoumean.pl
edi_accounts.pl
edi_ean_accounts.pl
import_export_framework.pl
item_circulation_alerts.pl Bug 23271: Replace search_limited with search_with_library_limits 2021-04-21 15:25:07 +02:00
items_search_field.pl
items_search_fields.pl
itemtypes.pl Bug 23207: Add automatic checkin feature 2021-04-22 11:11:05 +02:00
koha2marclinks.pl
library_groups.pl
localization.pl
marc_subfields_structure.pl Bug 8976: Code cleaning 2021-03-01 15:14:22 +01:00
marctagstructure.pl Bug 28207: Fix biblio_framework.frameworktext isn't in GROUP BY 2021-04-30 17:07:32 +02:00
matching-rules.pl
oai_set_mappings.pl
oai_sets.pl
overdrive.pl
patron-attr-types.pl Bug 23271: (follow-up) Fix typo 'limlits' 2021-04-23 13:55:09 +02:00
preferences.pl Bug 27805: Use input type "email" for email preferences 2021-04-06 15:56:30 +02:00
share_content.pl
smart-rules.pl
sms_providers.pl
smtp_servers.pl
sru_modmapping.pl
systempreferences.pl Bug 28276: Do not fetch config ($KOHA_CONF) from memcached 2021-05-10 10:28:04 +02:00
transfer_limits.pl Bug 26633: Fix indirect object notation 2021-03-16 16:08:30 +01:00
transport-cost-matrix.pl
usage_statistics.pl
z3950servers.pl