From c0e2c4808bade7108c2e3c13c600f76c7a6b224f Mon Sep 17 00:00:00 2001 From: dlandon Date: Thu, 14 Nov 2024 12:20:56 -0600 Subject: [PATCH] Fix invalid situation where useCache is 'no' when array is enabled. --- emhttp/plugins/dynamix/ShareEdit.page | 5 +++++ emhttp/plugins/dynamix/include/ShareList.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/emhttp/plugins/dynamix/ShareEdit.page b/emhttp/plugins/dynamix/ShareEdit.page index 093ad9ff6..2c002922d 100644 --- a/emhttp/plugins/dynamix/ShareEdit.page +++ b/emhttp/plugins/dynamix/ShareEdit.page @@ -56,6 +56,11 @@ if ((! $share['cachePool']) && ($share['cachePool2'])) { $share['cachePool2'] = ""; } +/* If useCache is "no" with an array, this is invalid and useCache has to be 'only'. */ +if ((! $poolsOnly) && ($share['useCache'] == "no")) { + $share['useCache'] = 'only'; +} + /* Check for non existent pool device. */ if ($share['cachePool'] && !in_array($share['cachePool'], $pools)) { $poolDefined = false; diff --git a/emhttp/plugins/dynamix/include/ShareList.php b/emhttp/plugins/dynamix/include/ShareList.php index 20b64fb85..6950802ae 100644 --- a/emhttp/plugins/dynamix/include/ShareList.php +++ b/emhttp/plugins/dynamix/include/ShareList.php @@ -214,8 +214,8 @@ foreach ($shares as $name => $share) { $share_valid = true; } - /* When there is no array, all pools are treated as 'only' cache. */ - if (($poolsOnly) && (! $share['cachePool2'])) { + /* When there is no array, all pools are treated as 'only' cache. If useCache is "no" with an array, this is invalid and useCache has to be 'only'. */ + if ((($poolsOnly) && (! $share['cachePool2'])) || ((! $poolsOnly) && ($share['useCache'] == "no"))) { $share['useCache'] = 'only'; }