With memcache enabled, when the value of the Editor parameter in a MARC framework is changed, the change is not reflected in the framework as presented in the Cataloguing module. The problem is resolved by disabling memcache. To prove: Enable memcache. Select Administration / MARC bibliographic framework / Default framework : click on MARC structure For tag 015, click on Subfields : note there are four subfields, of which 2 and a are not 'hidden' but 6 and 8 are 'hidden'. Click Edit Subfields and for subfield 8, Display More Constraints; note the Visibility line: OPAC checked (show) Intranet checked (show) Editor not checked (don't show) Collapsed not checked (show the non-hidden subfields, don't collapse to show the tag only) Go to the data base and select the marc_subfield_structure table. Observe that for tagfield 015, tagsubfield 8 and frameworkcode ' ' the value of 'hidden' is -6. This is correct. We understand that if the value is -6 then the subfield is not shown in the editor. This can be confirmed by going to the cataloguing module, selecting New Record and Default framework. Check tag 015 - subfield 8 is not displayed. Now edit subfield 8 and set Editor to 'checked'. Return to the data base and confirm that 015 subfield 8 for the default framework now has 'Hidden' set to 0 (zero). Subfield 8 should now display in the cataloguing editor. Return to the /cataloguing editor and confirm that subfield 8 is not displayed. Disabling memcache resolves the problem.
There's two levels of caching happening, memoisation and an in process cache. Both must go.
Created attachment 26947 [details] [review] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around.
Created attachment 26948 [details] [review] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Test plan: * work through http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0 and make sure that the erronious result doesn't occur. Note: * The patch on bug 12041 is required for this to work.
Created attachment 28414 [details] [review] [signed off] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Test plan: * work through http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0 and make sure that the erronious result doesn't occur. Note: * The patch on bug 12041 is required for this to work. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
I haven't tried using memcache/caching in ages. What's required to set it up on a git dev installation?
(In reply to Katrin Fischer from comment #5) > I haven't tried using memcache/caching in ages. What's required to set it up > on a git dev installation? Install memcache and then add some SetEnv lines to your apache config, e.g. SetEnv MEMCACHED_SERVERS 127.0.0.1:11211 SetEnv MEMCACHED_NAMESPACE koha make sure memcached is actually running, and it should just start working. There's a script that comes with memcache that lets you dump all its contents which is handy to see that it's actually being used.
Created attachment 29917 [details] [review] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Test plan: * work through http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0 and make sure that the erronious result doesn't occur. Note: * The patch on bug 12041 is required for this to work. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> I confirm the issue and that this patch fixes it!
Is this bug present in current maste ror just 3.12? Also, does it affect any setup or just Plack?
(In reply to Tomás Cohen Arazi from comment #8) > Is this bug present in current maste ror just 3.12? Also, does it affect any > setup or just Plack? I tested on master. I didn't reproduce the issue without Plack OR Memcache.
Patch pushed to master. Thanks Robin!
I think this might have an unwanted side effect. When trying to access my MARC bibliographic frameworks from administration, following erros is shown: Open of share file /tmp/sharefile-koha-koha failed: Permission denied at /usr/lib/perl5/Cache/FastMmap.pm line 640.
I haven't set up caching or anything.