Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - magento#18758: [Backport] Fix the typo in PHPDoc comment (by @dmytro-ch)
 - magento#18424: [BACKPORT] type casted $qty to float in \Magento\Catalog\Model\Produc� (by @lewisvoncken)
 - magento#15366: 15259 : Unable to disable without providing Industry value (by @sunilit42)
 - magento#18660: [Backport] Fix of saving "clone_field" fields (by @gelanivishal)


Fixed GitHub Issues:
 - magento#18094: Should getQty() return int/float or string? (reported by @sreichel) has been fixed in magento#18424 by @lewisvoncken in 2.2-develop branch
   Related commits:
     1. 3fc107a
     2. fa52936

 - magento#15259: Advanced Reporting > Unable to disable without providing Industry value (reported by @Detzler) has been fixed in magento#15366 by @sunilit42 in 2.2-develop branch
   Related commits:
     1. 274fee9
  • Loading branch information
Oleksii Korshenko authored Oct 23, 2018
2 parents e9c1946 + 71e5870 commit 42eebbb
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
3 changes: 3 additions & 0 deletions app/code/Magento/Analytics/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<source_model>Magento\Analytics\Model\Config\Source\Vertical</source_model>
<backend_model>Magento\Analytics\Model\Config\Backend\Vertical</backend_model>
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\Vertical</frontend_model>
<depends>
<field id="analytics/general/enabled">1</field>
</depends>
</field>
<field id="additional_comment" translate="label comment" type="label" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
<label><![CDATA[<strong>Get more insights from Magento Business Intelligence</strong>]]></label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
*/
class BackendModel extends Value
{
/** Maximum dmin session lifetime; 1 year*/
/** Maximum admin session lifetime; 1 year*/
const MAX_LIFETIME = 31536000;

/** Minimum admin session lifetime */
const MIN_LIFETIME = 60;

/**
* Processing object before save data
*
* @since 100.1.0
* @throws LocalizedException
*/
public function beforeSave()
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ public function setQty($qty)
*/
public function getQty()
{
return $this->getData('qty');
return (float)$this->getData('qty');
}

/**
Expand Down
9 changes: 5 additions & 4 deletions app/code/Magento/Config/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,14 @@ private function getField(string $sectionId, string $groupId, string $fieldId):
* Get field path
*
* @param Field $field
* @param string $fieldId Need for support of clone_field feature
* @param array &$oldConfig Need for compatibility with _processGroup()
* @param array &$extraOldGroups Need for compatibility with _processGroup()
* @return string
*/
private function getFieldPath(Field $field, array &$oldConfig, array &$extraOldGroups): string
private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string
{
$path = $field->getGroupPath() . '/' . $field->getId();
$path = $field->getGroupPath() . '/' . $fieldId;

/**
* Look for custom defined field path
Expand Down Expand Up @@ -303,7 +304,7 @@ private function getChangedPaths(
if (isset($groupData['fields'])) {
foreach ($groupData['fields'] as $fieldId => $fieldData) {
$field = $this->getField($sectionId, $groupId, $fieldId);
$path = $this->getFieldPath($field, $oldConfig, $extraOldGroups);
$path = $this->getFieldPath($field, $fieldId, $oldConfig, $extraOldGroups);
if ($this->isValueChanged($oldConfig, $path, $fieldData)) {
$changedPaths[] = $path;
}
Expand Down Expand Up @@ -398,7 +399,7 @@ protected function _processGroup(
$backendModel->addData($data);
$this->_checkSingleStoreMode($field, $backendModel);

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

$inherit = !empty($fieldData['inherit']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ public function getAnalyticsStatus()

/**
* @param string $vertical
* @return array|string
* @return $this
*/
public function setAnalyticsVertical($vertical)
{
return $this->_rootElement->find($this->analyticsVertical, Locator::SELECTOR_CSS, 'select')
->setValue($vertical);

$element = $this->_rootElement->find($this->analyticsVertical, Locator::SELECTOR_CSS, 'select');
if ($element->isVisible()) {
$element->setValue($vertical);
}

return $this;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsCon
'Subscription status: Disabled',
'Magento Advanced Reporting service subscription status is not disabled.'
);
\PHPUnit_Framework_Assert::assertFalse(
(bool)$configAnalytics->getAnalyticsForm()->getAnalyticsVerticalScope(),
'Industry Data is visible.'
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsCon
(bool)$configAnalytics->getAnalyticsForm()->isAnalyticsEnabled(),
'Magento Advanced Reporting service is not enabled.'
);

\PHPUnit_Framework_Assert::assertEquals(
$configAnalytics->getAnalyticsForm()->getAnalyticsStatus(),
'Subscription status: Pending',
'Magento Advanced Reporting service subscription status is not pending.'
);
\PHPUnit_Framework_Assert::assertTrue(
(bool)$configAnalytics->getAnalyticsForm()->getAnalyticsVerticalScope(),
'Industry Data is not visible.'
);
}

/**
Expand Down

0 comments on commit 42eebbb

Please sign in to comment.