Skip to content

Commit

Permalink
Merge branch 2.3-develop into ENGCOM-4146-magento-magento2-20896
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-engcom-team committed Feb 11, 2019
2 parents 5840ac1 + b2f1417 commit bf9589e
Show file tree
Hide file tree
Showing 215 changed files with 4,159 additions and 1,581 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="notifications">
<uiComponent name="notification_area"/>
<uiComponent name="notification_area" aclResource="Magento_AdminNotification::show_list"/>
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
name="unread_system_messages"
as="unread_system_messages"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

namespace Magento\Backend\Controller\Adminhtml\Dashboard;

class RefreshStatistics extends \Magento\Reports\Controller\Adminhtml\Report\Statistics
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Reports\Controller\Adminhtml\Report\Statistics;

/**
* Refresh Dashboard statistics action.
*/
class RefreshStatistics extends Statistics implements HttpPostActionInterface
{
/**
* @param \Magento\Backend\App\Action\Context $context
Expand All @@ -25,6 +31,8 @@ public function __construct(
}

/**
* Refresh statistics.
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@

<!--Choose Master Card from drop-down list-->
<switchToIFrame stepKey="switchToCardNumber" selector="{{NewOrderSection.cardFrame}}"/>
<waitForElementVisible selector="{{NewOrderSection.creditCardNumber}}" stepKey="waitForFillCardNumber"/>
<fillField stepKey="fillCardNumber" selector="{{NewOrderSection.creditCardNumber}}" userInput="{{PaymentAndShippingInfo.cardNumber}}"/>
<waitForPageLoad stepKey="waitForFillCardNumber"/>
<switchToIFrame stepKey="switchBackFromCard"/>

<!--Fill expire date-->
<switchToIFrame stepKey="switchToExpirationMonth" selector="{{NewOrderSection.monthFrame}}"/>
<waitForElementVisible selector="{{NewOrderSection.expirationMonth}}" stepKey="waitForFillMonth"/>
<fillField stepKey="fillMonth" selector="{{NewOrderSection.expirationMonth}}" userInput="{{PaymentAndShippingInfo.month}}"/>
<waitForPageLoad stepKey="waitForFillMonth"/>
<switchToIFrame stepKey="switchBackFromMonth"/>
<switchToIFrame stepKey="switchToExpirationYear" selector="{{NewOrderSection.yearFrame}}"/>
<waitForElementVisible selector="{{NewOrderSection.expirationYear}}" stepKey="waitForFillYear"/>
<fillField stepKey="fillYear" selector="{{NewOrderSection.expirationYear}}" userInput="{{PaymentAndShippingInfo.year}}"/>
<waitForPageLoad stepKey="waitForFillYear"/>
<switchToIFrame stepKey="switchBackFromYear"/>

<!--Fill CVW code-->
<switchToIFrame stepKey="switchToCVV" selector="{{NewOrderSection.cvvFrame}}"/>
<waitForElementVisible selector="{{NewOrderSection.cvv}}" stepKey="waitForFillCVV"/>
<fillField stepKey="fillCVV" selector="{{NewOrderSection.cvv}}" userInput="{{PaymentAndShippingInfo.cvv}}"/>
<wait stepKey="waitForFillCVV" time="1"/>
<switchToIFrame stepKey="switchBackFromCVV"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-93677"/>
<group value="braintree"/>
<skip>
<issueId value="MC-13779"/>
</skip>
</annotations>


Expand Down Expand Up @@ -63,21 +60,25 @@
<argument name="customer" value="Simple_US_Customer"/>
</actionGroup>

<!--Add Product to Order-->
<actionGroup ref="addSimpleProductToOrder" stepKey="addProduct">
<argument name="product" value="_defaultProduct"/>
</actionGroup>

<!--Fill Order Customer Information-->
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress">
<argument name="customer" value="Simple_US_Customer"/>
<argument name="address" value="US_Address_TX"/>
</actionGroup>

<!--Select Shipping-->
<actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/>

<waitForPageLoad stepKey="waitForShippingToFinish"/>

<!--Pay with Braintree -->
<actionGroup ref="useBraintreeForMasterCard" stepKey="selectCardWithBraintree"/>

<!--Submit Order-->
<click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/>
<waitForPageLoad stepKey="waitForSaveConfig"/>
<waitForElementVisible selector="{{NewOrderSection.successMessage}}" stepKey="waitForSuccessMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Fieldset;

/**
* Catalog fieldset element renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Fieldset;

class Element extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element
{
/**
Expand All @@ -29,7 +29,7 @@ public function getDataObject()
}

/**
* Retireve associated with element attribute object
* Retrieve associated with element attribute object
*
* @return \Magento\Catalog\Model\ResourceModel\Eav\Attribute
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab;

use Magento\Customer\Api\Data\GroupInterface;

/**
* Products mass update inventory tab
*
Expand All @@ -31,29 +29,20 @@ class Inventory extends \Magento\Backend\Block\Widget implements \Magento\Backen
*/
protected $disabledFields = [];

/**
* @var \Magento\Framework\Serialize\SerializerInterface
*/
private $serializer;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\CatalogInventory\Model\Source\Backorders $backorders
* @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
* @param array $data
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\CatalogInventory\Model\Source\Backorders $backorders,
\Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration,
array $data = [],
\Magento\Framework\Serialize\SerializerInterface $serializer = null
array $data = []
) {
$this->_backorders = $backorders;
$this->stockConfiguration = $stockConfiguration;
$this->serializer = $serializer ?? \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\SerializerInterface::class);
parent::__construct($context, $data);
}

Expand Down Expand Up @@ -85,9 +74,7 @@ public function getFieldSuffix()
*/
public function getStoreId()
{
$storeId = (int)$this->getRequest()->getParam('store');

return $storeId;
return (int)$this->getRequest()->getParam('store');
}

/**
Expand All @@ -101,22 +88,6 @@ public function getDefaultConfigValue($field)
return $this->stockConfiguration->getDefaultConfigValue($field);
}

/**
* Returns min_sale_qty configuration for the ALL Customer Group
*
* @return float
*/
public function getDefaultMinSaleQty()
{
$default = $this->stockConfiguration->getDefaultConfigValue('min_sale_qty');
if (!is_numeric($default)) {
$default = $this->serializer->unserialize($default);
$default = $default[GroupInterface::CUST_GROUP_ALL] ?? 1;
}

return (float) $default;
}

/**
* Tab settings
*
Expand Down
32 changes: 20 additions & 12 deletions app/code/Magento/Catalog/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements

const CACHE_TAG = 'cat_c';

/**
* Category Store Id
*/
const STORE_ID = 'store_id';

/**#@-*/
protected $_eventPrefix = 'catalog_category';

Expand Down Expand Up @@ -573,8 +568,8 @@ public function getStoreIds()
*/
public function getStoreId()
{
if ($this->hasData(self::STORE_ID)) {
return (int)$this->_getData(self::STORE_ID);
if ($this->hasData('store_id')) {
return (int)$this->_getData('store_id');
}
return (int)$this->_storeManager->getStore()->getId();
}
Expand All @@ -590,7 +585,7 @@ public function setStoreId($storeId)
if (!is_numeric($storeId)) {
$storeId = $this->_storeManager->getStore($storeId)->getId();
}
$this->setData(self::STORE_ID, $storeId);
$this->setData('store_id', $storeId);
$this->getResource()->setStoreId($storeId);
return $this;
}
Expand Down Expand Up @@ -1124,10 +1119,15 @@ public function reindex()
}
}
$productIndexer = $this->indexerRegistry->get(Indexer\Category\Product::INDEXER_ID);
if (!$productIndexer->isScheduled()
&& (!empty($this->getAffectedProductIds()) || $this->dataHasChangedFor('is_anchor'))
) {
$productIndexer->reindexList($this->getPathIds());

if (!empty($this->getAffectedProductIds())
|| $this->dataHasChangedFor('is_anchor')
|| $this->dataHasChangedFor('is_active')) {
if (!$productIndexer->isScheduled()) {
$productIndexer->reindexList($this->getPathIds());
} else {
$productIndexer->invalidate();
}
}
}

Expand All @@ -1152,9 +1152,17 @@ public function getIdentities()
$identities = [
self::CACHE_TAG . '_' . $this->getId(),
];

if ($this->hasDataChanges()) {
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $this->getId();
}

if ($this->dataHasChangedFor('is_anchor') || $this->dataHasChangedFor('is_active')) {
foreach ($this->getPathIds() as $id) {
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $id;
}
}

if (!$this->getId() || $this->isDeleted() || $this->dataHasChangedFor(self::KEY_INCLUDE_IN_MENU)) {
$identities[] = self::CACHE_TAG;
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $this->getId();
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/Catalog/Model/ImageExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ImageExtractor implements TypeDataExtractorInterface
* @param \DOMElement $mediaNode
* @param string $mediaParentTag
* @return array
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function process(\DOMElement $mediaNode, $mediaParentTag)
{
Expand All @@ -40,6 +41,12 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
$nodeValue = $this->processImageBackground($attribute->nodeValue);
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
$nodeValue = (int) $attribute->nodeValue;
} elseif ($attributeTagName === 'constrain'
|| $attributeTagName === 'aspect_ratio'
|| $attributeTagName === 'frame'
|| $attributeTagName === 'transparency'
) {
$nodeValue = in_array($attribute->nodeValue, [true, 1, 'true', '1'], true) ?? false;
} else {
$nodeValue = $attribute->nodeValue;
}
Expand Down
5 changes: 0 additions & 5 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
*/
const STORE_ID = 'store_id';

/**
* Product Url path.
*/
const URL_PATH = 'url_path';

/**
* @var string
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/Product/Copier.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function copy(Product $product)
? $matches[1] . '-' . ($matches[2] + 1)
: $urlKey . '-1';
$duplicate->setUrlKey($urlKey);
$duplicate->setData(Product::URL_PATH, null);
$duplicate->setData('url_path', null);
try {
$duplicate->save();
$isDuplicateSaved = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ private function getWatermark(string $type): array
*/
private function hasDefaultFrame(): bool
{
return (bool) $this->viewConfig->getViewConfig()->getVarValue(
'Magento_Catalog',
'product_image_white_borders'
);
return (bool) $this->viewConfig->getViewConfig(['area' => \Magento\Framework\App\Area::AREA_FRONTEND])
->getVarValue('Magento_Catalog', 'product_image_white_borders');
}
}
Loading

0 comments on commit bf9589e

Please sign in to comment.