From 464939536438456e8a0f1e6dc7974f28cb1c0e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Ga=C5=A1pari=C4=87?= Date: Fri, 12 Sep 2025 14:30:03 +0200 Subject: [PATCH 1/2] cache Don't use cache when $identifierValue is provided. Remote data source has pagination and does not return all the data at once --- 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..753554a 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); } From 8f98b4fc71e8415df15fa0a50a44647733400608 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Fri, 12 Sep 2025 12:30:13 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- 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 753554a..f00499b 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 (!!$identifierValue && config('asseco-custom-fields.should_cache_remote') && Cache::has($cacheKey)) { + if ((bool) $identifierValue && config('asseco-custom-fields.should_cache_remote') && Cache::has($cacheKey)) { return Cache::get($cacheKey); }