From 4e9a4a3ea0d2a20eef8dd5bd3bf0c6839e843735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Ga=C5=A1pari=C4=87?= Date: Fri, 12 Sep 2025 14:32:23 +0200 Subject: [PATCH 1/2] Revert "cache (#108)" This reverts commit 90fa613885fff7883d5ee6f007284a3b63d1a09a. --- src/App/Models/RemoteType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/Models/RemoteType.php b/src/App/Models/RemoteType.php index f00499b..16f7c14 100644 --- a/src/App/Models/RemoteType.php +++ b/src/App/Models/RemoteType.php @@ -81,7 +81,7 @@ private function fetchData(?string $value = null, bool $search = false) public function getRemoteData(?string $identifierValue = null) { $cacheKey = 'remote_custom_field_' . $this->id; - if ((bool) $identifierValue && config('asseco-custom-fields.should_cache_remote') && Cache::has($cacheKey)) { + if (config('asseco-custom-fields.should_cache_remote') && Cache::has($cacheKey)) { return Cache::get($cacheKey); } From 6fdf0fdb5c44cff0aa8c7d6563a83f7522e9d171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Ga=C5=A1pari=C4=87?= Date: Fri, 12 Sep 2025 14:33:56 +0200 Subject: [PATCH 2/2] cache_remote only if not $identifierValue --- src/App/Models/RemoteType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/Models/RemoteType.php b/src/App/Models/RemoteType.php index 16f7c14..3da716a 100644 --- a/src/App/Models/RemoteType.php +++ b/src/App/Models/RemoteType.php @@ -81,7 +81,7 @@ private function fetchData(?string $value = null, bool $search = false) public function getRemoteData(?string $identifierValue = null) { $cacheKey = 'remote_custom_field_' . $this->id; - if (config('asseco-custom-fields.should_cache_remote') && Cache::has($cacheKey)) { + if (!$identifierValue && config('asseco-custom-fields.should_cache_remote') && Cache::has($cacheKey)) { return Cache::get($cacheKey); }