Skip to content

Commit 57175a5

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #20322: issue #19609 Fixed for 2.2-develop (by @maheshWebkul721) - #20206: 9130 remove the negative qty block. (by @saphaljha) - #19964: [Backport] Fix the issue with reset password when customer has address from not allowed country (by @dmytro-ch) - #19984: [Backport] Remove unneeded, also mistyped, saveHandler from CatalogSearch indexer declaration (by @dmytro-ch) Fixed GitHub Issues: - #19609: config:set --lock-config does not act on other scopes (reported by @kassner) has been fixed in #20322 by @maheshWebkul721 in 2.2-develop branch Related commits: 1. c72cbfc 2. 816be4b - #9130: If stock is bellow OutOfStock Threshold, a negative qty is displayed in Product List Page (reported by @popoviciandrei) has been fixed in #20206 by @saphaljha in 2.2-develop branch Related commits: 1. 2b88353 2. 304e7e8 - #18170: Unable to reset password if customer has address from not allowed country (reported by @ihor-sviziev) has been fixed in #19964 by @dmytro-ch in 2.2-develop branch Related commits: 1. 317c02a - #19982: Catalogsearch Reindex (reported by @vincent2090311) has been fixed in #19984 by @dmytro-ch in 2.2-develop branch Related commits: 1. 089c660
2 parents 8170336 + 679008f commit 57175a5

File tree

8 files changed

+108
-34
lines changed

8 files changed

+108
-34
lines changed

app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ public function getPlaceholderId()
131131
*/
132132
public function isMsgVisible()
133133
{
134-
return $this->getStockQty() > 0 && $this->getStockQtyLeft() <= $this->getThresholdQty();
134+
return $this->getStockQty() > 0 && $this->getStockQtyLeft() > 0
135+
&& $this->getStockQtyLeft() <= $this->getThresholdQty();
135136
}
136137

137138
/**

app/code/Magento/CatalogSearch/etc/indexer.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext">
1010
<title translate="true">Catalog Search</title>
1111
<description translate="true">Rebuild Catalog product fulltext search index</description>
12-
13-
<saveHandler class="Magento\CatalogSearch\Model\Indexer\IndexHandler" />
1412
<structure class="Magento\CatalogSearch\Model\Indexer\IndexStructure" />
1513
</indexer>
1614
</config>

app/code/Magento/Config/Block/System/Config/Form.php

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ public function __construct(
143143
\Magento\Config\Model\Config\Structure $configStructure,
144144
\Magento\Config\Block\System\Config\Form\Fieldset\Factory $fieldsetFactory,
145145
\Magento\Config\Block\System\Config\Form\Field\Factory $fieldFactory,
146-
array $data = []
146+
array $data = [],
147+
SettingChecker $settingChecker = null
147148
) {
148149
parent::__construct($context, $registry, $formFactory, $data);
149150
$this->_configFactory = $configFactory;
150151
$this->_configStructure = $configStructure;
151152
$this->_fieldsetFactory = $fieldsetFactory;
152153
$this->_fieldFactory = $fieldFactory;
154+
$this->settingChecker = $settingChecker ?: ObjectManager::getInstance()->get(SettingChecker::class);
153155

154156
$this->_scopeLabels = [
155157
self::SCOPE_DEFAULT => __('[GLOBAL]'),
@@ -158,18 +160,6 @@ public function __construct(
158160
];
159161
}
160162

161-
/**
162-
* @deprecated 100.1.2
163-
* @return SettingChecker
164-
*/
165-
private function getSettingChecker()
166-
{
167-
if ($this->settingChecker === null) {
168-
$this->settingChecker = ObjectManager::getInstance()->get(SettingChecker::class);
169-
}
170-
return $this->settingChecker;
171-
}
172-
173163
/**
174164
* Initialize objects required to render config form
175165
*
@@ -366,9 +356,8 @@ protected function _initElement(
366356

367357
$sharedClass = $this->_getSharedCssClass($field);
368358
$requiresClass = $this->_getRequiresCssClass($field, $fieldPrefix);
359+
$isReadOnly = $this->isReadOnly($field, $path);
369360

370-
$isReadOnly = $this->getElementVisibility()->isDisabled($field->getPath())
371-
?: $this->getSettingChecker()->isReadOnly($path, $this->getScope(), $this->getStringScopeCode());
372361
$formField = $fieldset->addField(
373362
$elementId,
374363
$field->getType(),
@@ -417,7 +406,7 @@ private function getFieldData(\Magento\Config\Model\Config\Structure\Element\Fie
417406
{
418407
$data = $this->getAppConfigDataValue($path);
419408

420-
$placeholderValue = $this->getSettingChecker()->getPlaceholderValue(
409+
$placeholderValue = $this->settingChecker->getPlaceholderValue(
421410
$path,
422411
$this->getScope(),
423412
$this->getStringScopeCode()
@@ -718,6 +707,7 @@ protected function _getAdditionalElementTypes()
718707
*
719708
* @TODO delete this methods when {^see above^} is done
720709
* @return string
710+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
721711
*/
722712
public function getSectionCode()
723713
{
@@ -729,6 +719,7 @@ public function getSectionCode()
729719
*
730720
* @TODO delete this methods when {^see above^} is done
731721
* @return string
722+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
732723
*/
733724
public function getWebsiteCode()
734725
{
@@ -740,6 +731,7 @@ public function getWebsiteCode()
740731
*
741732
* @TODO delete this methods when {^see above^} is done
742733
* @return string
734+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
743735
*/
744736
public function getStoreCode()
745737
{
@@ -797,6 +789,26 @@ private function getAppConfig()
797789
return $this->appConfig;
798790
}
799791

792+
/**
793+
* Check Path is Readonly
794+
*
795+
* @param \Magento\Config\Model\Config\Structure\Element\Field $field
796+
* @param string $path
797+
* @return boolean
798+
*/
799+
private function isReadOnly(\Magento\Config\Model\Config\Structure\Element\Field $field, $path)
800+
{
801+
$isReadOnly = $this->settingChecker->isReadOnly(
802+
$path,
803+
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
804+
);
805+
if (!$isReadOnly) {
806+
$isReadOnly = $this->getElementVisibility()->isDisabled($field->getPath())
807+
?: $this->settingChecker->isReadOnly($path, $this->getScope(), $this->getStringScopeCode());
808+
}
809+
return $isReadOnly;
810+
}
811+
800812
/**
801813
* Retrieve deployment config data value by path
802814
*

app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ protected function setUp()
103103
$this->_fieldsetFactoryMock = $this->createMock(\Magento\Config\Block\System\Config\Form\Fieldset\Factory::class);
104104
$this->_fieldFactoryMock = $this->createMock(\Magento\Config\Block\System\Config\Form\Field\Factory::class);
105105
$this->_coreConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
106+
$settingCheckerMock = $this->getMockBuilder(SettingChecker::class)
107+
->disableOriginalConstructor()
108+
->getMock();
106109

107110
$this->_backendConfigMock = $this->createMock(\Magento\Config\Model\Config::class);
108111

@@ -150,6 +153,7 @@ protected function setUp()
150153
'fieldsetFactory' => $this->_fieldsetFactoryMock,
151154
'fieldFactory' => $this->_fieldFactoryMock,
152155
'context' => $context,
156+
'settingChecker' => $settingCheckerMock,
153157
];
154158

155159
$objectArguments = $helper->getConstructArguments(\Magento\Config\Block\System\Config\Form::class, $data);
@@ -529,7 +533,7 @@ public function testInitFields(
529533

530534
$elementVisibilityMock = $this->getMockBuilder(ElementVisibilityInterface::class)
531535
->getMockForAbstractClass();
532-
$elementVisibilityMock->expects($this->once())
536+
$elementVisibilityMock->expects($this->any())
533537
->method('isDisabled')
534538
->willReturn($isDisabled);
535539

app/code/Magento/Config/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Config" setup_version="2.0.0">
9+
<module name="Magento_Config" setup_version="2.1.0">
1010
<sequence>
1111
<module name="Magento_Store"/>
1212
</sequence>

0 commit comments

Comments
 (0)