LP#1786987: Locale-less org tree cache object becomes stale
authorMike Rylander <mrylander@gmail.com>
Mon, 27 Aug 2018 16:08:37 +0000 (12:08 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 26 Sep 2018 19:19:48 +0000 (15:19 -0400)
The autogen.sh script calls a function that flushes all org tree objects
cached by locale, but does not flush the one used when the locale is
unkown.  This commit forces that flushing to occur.

berick: Definition of my $cache pushed up above first use.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/Configure.pm

index 4bd5b3a..351a129 100644 (file)
@@ -88,9 +88,12 @@ sub org_tree_js {
     # Get our list of locales
     my $locales = get_locales();
 
+    # Remove the no-locale copy
+    my $cache = OpenSRF::Utils::Cache->new;
+    $cache->delete_cache("orgtree.");
+
     foreach my $locale (@$locales) {
         warn "removing OrgTree from the cache for locale " . $locale->code . "...\n";
-        my $cache = OpenSRF::Utils::Cache->new;
         $cache->delete_cache("orgtree.".$locale->code);
 
         # fetch the org_unit's and org_unit_type's