Merge pull request #1924 from dlandon/situation_where_share_shows_array_when_not_on_the_array

Fix invalid situation where useCache is 'no' when array is enabled.
This commit is contained in:
tom mortensen
2024-11-15 16:04:29 -08:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -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;
+2 -2
View File
@@ -213,8 +213,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';
}