mirror of
https://github.com/unraid/webgui.git
synced 2026-01-04 08:29:51 -06:00
Default to first pool when array is missing on a share that was originally an array.
This commit is contained in:
@@ -63,7 +63,6 @@ if ((!$poolsOnly) && ($share['useCache'] == "no")) {
|
||||
|
||||
/* Check for non existent pool device. */
|
||||
if (($share['cachePool'] && !in_array($share['cachePool'], $pools))) {
|
||||
|
||||
$share['useCache'] = $share['cachePool2'] ? "yes" : ($poolsOnly ? "no" : "yes");
|
||||
$poolDefined = false;
|
||||
} else {
|
||||
@@ -1329,7 +1328,7 @@ $(function() {
|
||||
<?endif;?>
|
||||
initDropdown(true);
|
||||
<?if ($tabbed):?>
|
||||
$('#tab1').bind({
|
||||
$('#tab1').on({
|
||||
click: function() {
|
||||
initDropdown(true);
|
||||
}
|
||||
|
||||
@@ -187,10 +187,15 @@ define('LUKS_STATUS_UNENCRYPTED', 2);
|
||||
|
||||
// Build table
|
||||
$row = 0;
|
||||
|
||||
/* Get the first pool if needed. */
|
||||
$firstPool = $pools_check[0] ?? "";
|
||||
foreach ($shares as $name => $share) {
|
||||
/* Correct a situation in previous Unraid versions where an array only share has a useCache defined. */
|
||||
if ((!$poolsOnly) && ($share['useCache'] == "no")) {
|
||||
$share['cachePool'] = "";
|
||||
} else if (($poolsOnly) && (!$share['cachePool'])) {
|
||||
$share['cachePool'] = $firstPool;
|
||||
}
|
||||
|
||||
/* Is cachePool2 defined? If it is we need to show the cache pool 2 device name instead of 'Array'. */
|
||||
@@ -219,8 +224,8 @@ foreach ($shares as $name => $share) {
|
||||
$share_valid = true;
|
||||
}
|
||||
|
||||
/* 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['cachePool']) && ($share['useCache'] == "no"))) {
|
||||
/* When there is no array, all pools are treated as 'only' cache. */
|
||||
if (($poolsOnly) && (! $share['cachePool2'])) {
|
||||
$share['useCache'] = 'only';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user