Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 42eebbb

Browse files
author
Oleksii Korshenko
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - magento/magento2#18758: [Backport] Fix the typo in PHPDoc comment (by @dmytro-ch) - magento/magento2#18424: [BACKPORT] type casted $qty to float in \Magento\Catalog\Model\Produc� (by @lewisvoncken) - magento/magento2#15366: 15259 : Unable to disable without providing Industry value (by @sunilit42) - magento/magento2#18660: [Backport] Fix of saving "clone_field" fields (by @gelanivishal) Fixed GitHub Issues: - magento/magento2#18094: Should getQty() return int/float or string? (reported by @sreichel) has been fixed in magento/magento2#18424 by @lewisvoncken in 2.2-develop branch Related commits: 1. 3fc107a 2. fa52936 - magento/magento2#15259: Advanced Reporting > Unable to disable without providing Industry value (reported by @Detzler) has been fixed in magento/magento2#15366 by @sunilit42 in 2.2-develop branch Related commits: 1. 274fee9
2 parents e9c1946 + 71e5870 commit 42eebbb

File tree

7 files changed

+29
-10
lines changed

7 files changed

+29
-10
lines changed

app/code/Magento/Analytics/etc/adminhtml/system.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
<source_model>Magento\Analytics\Model\Config\Source\Vertical</source_model>
3737
<backend_model>Magento\Analytics\Model\Config\Backend\Vertical</backend_model>
3838
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\Vertical</frontend_model>
39+
<depends>
40+
<field id="analytics/general/enabled">1</field>
41+
</depends>
3942
</field>
4043
<field id="additional_comment" translate="label comment" type="label" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
4144
<label><![CDATA[<strong>Get more insights from Magento Business Intelligence</strong>]]></label>

app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
*/
1616
class BackendModel extends Value
1717
{
18-
/** Maximum dmin session lifetime; 1 year*/
18+
/** Maximum admin session lifetime; 1 year*/
1919
const MAX_LIFETIME = 31536000;
2020

2121
/** Minimum admin session lifetime */
2222
const MIN_LIFETIME = 60;
2323

2424
/**
25+
* Processing object before save data
26+
*
2527
* @since 100.1.0
28+
* @throws LocalizedException
2629
*/
2730
public function beforeSave()
2831
{

app/code/Magento/Catalog/Model/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ public function setQty($qty)
985985
*/
986986
public function getQty()
987987
{
988-
return $this->getData('qty');
988+
return (float)$this->getData('qty');
989989
}
990990

991991
/**

app/code/Magento/Config/Model/Config.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,14 @@ private function getField(string $sectionId, string $groupId, string $fieldId):
237237
* Get field path
238238
*
239239
* @param Field $field
240+
* @param string $fieldId Need for support of clone_field feature
240241
* @param array &$oldConfig Need for compatibility with _processGroup()
241242
* @param array &$extraOldGroups Need for compatibility with _processGroup()
242243
* @return string
243244
*/
244-
private function getFieldPath(Field $field, array &$oldConfig, array &$extraOldGroups): string
245+
private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string
245246
{
246-
$path = $field->getGroupPath() . '/' . $field->getId();
247+
$path = $field->getGroupPath() . '/' . $fieldId;
247248

248249
/**
249250
* Look for custom defined field path
@@ -303,7 +304,7 @@ private function getChangedPaths(
303304
if (isset($groupData['fields'])) {
304305
foreach ($groupData['fields'] as $fieldId => $fieldData) {
305306
$field = $this->getField($sectionId, $groupId, $fieldId);
306-
$path = $this->getFieldPath($field, $oldConfig, $extraOldGroups);
307+
$path = $this->getFieldPath($field, $fieldId, $oldConfig, $extraOldGroups);
307308
if ($this->isValueChanged($oldConfig, $path, $fieldData)) {
308309
$changedPaths[] = $path;
309310
}
@@ -398,7 +399,7 @@ protected function _processGroup(
398399
$backendModel->addData($data);
399400
$this->_checkSingleStoreMode($field, $backendModel);
400401

401-
$path = $this->getFieldPath($field, $extraOldGroups, $oldConfig);
402+
$path = $this->getFieldPath($field, $fieldId, $extraOldGroups, $oldConfig);
402403
$backendModel->setPath($path)->setValue($fieldData['value']);
403404

404405
$inherit = !empty($fieldData['inherit']);

dev/tests/functional/tests/app/Magento/Analytics/Test/Block/System/Config/AnalyticsForm.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,17 @@ public function getAnalyticsStatus()
9595

9696
/**
9797
* @param string $vertical
98-
* @return array|string
98+
* @return $this
9999
*/
100100
public function setAnalyticsVertical($vertical)
101101
{
102-
return $this->_rootElement->find($this->analyticsVertical, Locator::SELECTOR_CSS, 'select')
103-
->setValue($vertical);
102+
103+
$element = $this->_rootElement->find($this->analyticsVertical, Locator::SELECTOR_CSS, 'select');
104+
if ($element->isVisible()) {
105+
$element->setValue($vertical);
106+
}
107+
108+
return $this;
104109
}
105110

106111
/**

dev/tests/functional/tests/app/Magento/Analytics/Test/Constraint/AssertConfigAnalyticsDisabled.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsCon
3434
'Subscription status: Disabled',
3535
'Magento Advanced Reporting service subscription status is not disabled.'
3636
);
37+
\PHPUnit_Framework_Assert::assertFalse(
38+
(bool)$configAnalytics->getAnalyticsForm()->getAnalyticsVerticalScope(),
39+
'Industry Data is visible.'
40+
);
3741
}
3842

3943
/**

dev/tests/functional/tests/app/Magento/Analytics/Test/Constraint/AssertConfigAnalyticsEnabled.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsCon
2929
(bool)$configAnalytics->getAnalyticsForm()->isAnalyticsEnabled(),
3030
'Magento Advanced Reporting service is not enabled.'
3131
);
32-
3332
\PHPUnit_Framework_Assert::assertEquals(
3433
$configAnalytics->getAnalyticsForm()->getAnalyticsStatus(),
3534
'Subscription status: Pending',
3635
'Magento Advanced Reporting service subscription status is not pending.'
3736
);
37+
\PHPUnit_Framework_Assert::assertTrue(
38+
(bool)$configAnalytics->getAnalyticsForm()->getAnalyticsVerticalScope(),
39+
'Industry Data is not visible.'
40+
);
3841
}
3942

4043
/**

0 commit comments

Comments
 (0)