Skip to content

Commit b4035b5

Browse files
committed
MAGETWO-60746: [GITHUB] Edit default store view will stop saying that Default store cannot be disabled #7349
1 parent 0aa0031 commit b4035b5

File tree

1 file changed

+13
-2
lines changed
  • app/code/Magento/Backend/Block/System/Store/Edit/Form

1 file changed

+13
-2
lines changed

app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form)
100100
]
101101
);
102102

103+
$isDisabledStatusField = $storeModel->isReadOnly()
104+
|| ($storeModel->getId() && $storeModel->isDefault() && $storeModel->isActive());
103105
$fieldset->addField(
104106
'store_is_active',
105107
'select',
@@ -109,10 +111,19 @@ protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form)
109111
'value' => $storeModel->isActive(),
110112
'options' => [0 => __('Disabled'), 1 => __('Enabled')],
111113
'required' => true,
112-
'disabled' => $storeModel->isReadOnly()
113-
|| ($storeModel->getId() && $storeModel->isDefault() && $storeModel->isActive())
114+
'disabled' => $isDisabledStatusField
114115
]
115116
);
117+
if ($isDisabledStatusField) {
118+
$fieldset->addField(
119+
'store_is_active_hidden',
120+
'hidden',
121+
[
122+
'name' => 'store[is_active]',
123+
'value' => $storeModel->isActive(),
124+
]
125+
);
126+
}
116127

117128
$fieldset->addField(
118129
'store_sort_order',

0 commit comments

Comments
 (0)