[Bug 35811] New: Adding a new item type does not clear cache (causing new type to not show properly in OPAC)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35811 Bug ID: 35811 Summary: Adding a new item type does not clear cache (causing new type to not show properly in OPAC) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: schodkowy.omegi-0r@icloud.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Item type descriptions are cached with cache key of 'itemtype:description:'.$lang, which is used by function C4::Biblio::GetAuthorisedValueDesc, used for example in OPAC during display of item's item type in the details view table: https://github.com/Koha-Community/Koha/blob/3df1cb33c277925b689b1e45c736ea85... The problem is, when a new item type is added, that cache key isn't flushed, meaning the new item type won't be displayed in OPAC, an empty field will be shown instead. Flushing memcached mitigates this issue. The cache key is cleared here during tests for instance: https://github.com/Koha-Community/Koha/blob/3df1cb33c277925b689b1e45c736ea85... I suspect the cache flushing should occur in `admin/itemtypes.pl`, after $op 'add_validate'. However, I'm not sure how to get the list of all languages to purge (and I assume all of them should be purged). I've found code snippet below, but I'm not sure if this approach would be acceptable (after adjusting the regex of course), given this gets cache by `Koha::Cache::Memory::Lite->get_instance` instead of `Koha::Caches->get_instance`... my $memory_cache = Koha::Cache::Memory::Lite->get_instance; for my $k ( $memory_cache->all_keys ) { $memory_cache->clear_from_cache($k) if $k =~ m{^CircRules:}; } I've also found this snippet (I see itemtypes.pl calls ->store, so this gets called too): https://github.com/Koha-Community/Koha/blob/2ce83fc784ad8bc716bd65f148451410... It seems to purge only English, which might be why I experienced the issue that I've experienced. So the question that prevails then is: how do we purge all the used languages? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35811 David Roberts <david.roberts@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david.roberts@openfifth.co. | |uk --- Comment #1 from David Roberts <david.roberts@openfifth.co.uk> --- I think this is also affecting the staff client - a new item type doesn't display in the holdings table on detail.pl until memcached is restarted. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35811 Marie-Luce Laflamme <marie-luce.laflamme@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marie-luce.laflamme@inlibro | |.com --- Comment #2 from Marie-Luce Laflamme <marie-luce.laflamme@inlibro.com> --- Yes, we've noticed this behaviour in staff interface as well (25.05). We often need to restart memcached on the server to display new item types. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org