Koha/misc/translator
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
..
po Fix translation issues 2020-11-27 16:35:09 +01:00
LangInstaller.pm Bug 28276: Do not fetch config ($KOHA_CONF) from memcached 2021-05-10 10:28:04 +02:00
po2json Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
tmpl_process3.pl Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
TmplTokenizer.pm Bug 21395: (QA follow-up) Remove some introduced issues 2020-06-29 12:37:02 +02:00
translate Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
VerboseWarnings.pm Bug 24000: Some modules do not return 1 2021-04-06 15:56:30 +02:00
xgettext-installer Bug 28154: Fix encoding issues on Koha-installer.pot 2021-04-16 13:53:54 +02:00
xgettext-pref Bug 28154: Fix encoding issues on Koha-pref.pot 2021-04-16 13:53:54 +02:00
xgettext-tt2 Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
xgettext.pl Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00