File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
classes/ColdTrick/WidgetManager Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ public static function getContentFromCache(\Elgg\Event $event): ?array {
132132 return null ;
133133 }
134134
135- $ cached_data = elgg_load_system_cache ("widget_cache_ {$ widget ->guid }" );
135+ $ current_language = elgg_get_current_language ();
136+ $ cached_data = elgg_load_system_cache ("widget_cache_ {$ widget ->guid }_ {$ current_language }" );
136137 if (empty ($ cached_data )) {
137138 return null ;
138139 }
@@ -187,7 +188,8 @@ public static function saveContentInCache(\Elgg\Event $event): void {
187188 return ;
188189 }
189190
190- elgg_save_system_cache ("widget_cache_ {$ widget ->guid }" , $ event ->getValue ());
191+ $ current_language = elgg_get_current_language ();
192+ elgg_save_system_cache ("widget_cache_ {$ widget ->guid }_ {$ current_language }" , $ event ->getValue ());
191193 }
192194
193195 /**
@@ -207,7 +209,10 @@ public static function clearWidgetCacheOnUpdate(\Elgg\Event $event): void {
207209 return ;
208210 }
209211
210- elgg_delete_system_cache ("widget_cache_ {$ widget ->guid }" );
212+ $ languages = elgg ()->translator ->getAllowedLanguages ();
213+ foreach ($ languages as $ language ) {
214+ elgg_delete_system_cache ("widget_cache_ {$ widget ->guid }_ {$ language }" );
215+ }
211216 }
212217
213218 /**
You can’t perform that action at this time.
0 commit comments