Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #21763: Spelling Correction (by @ansari-krish)
 - #21740: Removed extra whitespaces (by @yogeshsuhagiya)
 - #21731: Fixed wrong proxing in the inventory observer (by @VitaliyBoyko)
 - #21683: Correct spelling (by @ravi-chandra3197)
 - #21444: Disable dropdown in JavaScript and CSS Settings in developer configuration (by @ananth-iyer)
 - #21582: Fixed Whitespace issues for related, cross and upsell grids (by @amol2jcommerce)
 - #21600: Fixed typo mistake (by @yogeshsuhagiya)
 - #21468: Fix long string display horizontal scroll in all pages in admin (by @mageprince)
 - #21189: Fix/issue 18761 (by @DenisSaltanahmedov)
 - #21180: [ForwardPort] #18896 Add Mexico Regions (by @osrecio)
 - #20001: #13612 Fixed-Quantity_and_stock_status when visibility set to storefront throwing exception (by @aditisinghcedcoss)


Fixed GitHub Issues:
 - #167: Fatal error: Class 'Mage' not found (reported by @clockworkgeek) has been fixed in #21731 by @VitaliyBoyko in 2.3-develop branch
   Related commits:
     1. 3819dc1

 - #21384: JS minify field is not disabled in developer configuration (reported by @DanielRuf) has been fixed in #21444 by @ananth-iyer in 2.3-develop branch
   Related commits:
     1. a5bdc38
     2. ab2d0e4

 - #21541: Whitespace issues for related, cross and upsell grids (reported by @Zyles) has been fixed in #21582 by @amol2jcommerce in 2.3-develop branch
   Related commits:
     1. 9ab463f

 - #18761: Bug with REPLACE method in Advanced Prices in CSV Import  (reported by @kamilmaliszewski) has been fixed in #21189 by @DenisSaltanahmedov in 2.3-develop branch
   Related commits:
     1. a572ae2
     2. 6692e08

 - #13612: 1 exception(s): Exception #0 (Exception): Warning: Illegal offset type in isset or empty in /home/jewelrynest2/public_html/magento/vendor/magento/module-eav/Model/Entity/Attribute/Source/AbstractSource.php on line 76 (reported by @kamal3294) has been fixed in #20001 by @aditisinghcedcoss in 2.3-develop branch
   Related commits:
     1. 0df7243
     2. 887902b
  • Loading branch information
magento-engcom-team authored Mar 16, 2019
2 parents 7b1cd79 + 86bd66e commit 931f2ea
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 63 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ Tests:
* Fixed an issue where filters were not shown on product reviews report grid
* Fixed an issue where second customer address was not deleted from customer account
* Fixed an issue where custom options pop-up was still displayed after submit
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first atempt
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first attempt
* Fixed an issue where customer invalid email message was not displayed
* Fixed an issue where All Access Tokens for Customer without Tokens could not be revoked
* Fixed an issue where it was impossible to add Product to Shopping Cart from shared Wishlist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
* @param AdvancedPricing\Validator\Website $websiteValidator
* @param AdvancedPricing\Validator\TierPrice $tierPriceValidator
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @throws \Exception
*/
public function __construct(
\Magento\Framework\Json\Helper\Data $jsonHelper,
Expand Down Expand Up @@ -255,6 +256,7 @@ public function getEntityTypeCode()
* @param array $rowData
* @param int $rowNum
* @return bool
* @throws \Zend_Validate_Exception
*/
public function validateRow(array $rowData, $rowNum)
{
Expand Down Expand Up @@ -308,6 +310,7 @@ protected function _importData()
* Save advanced pricing
*
* @return $this
* @throws \Exception
*/
public function saveAdvancedPricing()
{
Expand All @@ -319,6 +322,7 @@ public function saveAdvancedPricing()
* Deletes Advanced price data from raw data.
*
* @return $this
* @throws \Exception
*/
public function deleteAdvancedPricing()
{
Expand Down Expand Up @@ -347,6 +351,7 @@ public function deleteAdvancedPricing()
* Replace advanced pricing
*
* @return $this
* @throws \Exception
*/
public function replaceAdvancedPricing()
{
Expand All @@ -360,6 +365,7 @@ public function replaceAdvancedPricing()
* @return $this
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @throws \Exception
*/
protected function saveAndReplaceAdvancedPrices()
{
Expand All @@ -368,8 +374,8 @@ protected function saveAndReplaceAdvancedPrices()
$this->_cachedSkuToDelete = null;
}
$listSku = [];
$tierPrices = [];
while ($bunch = $this->_dataSourceModel->getNextBunch()) {
$tierPrices = [];
foreach ($bunch as $rowNum => $rowData) {
if (!$this->validateRow($rowData, $rowNum)) {
$this->addRowError(ValidatorInterface::ERROR_SKU_IS_EMPTY, $rowNum);
Expand Down Expand Up @@ -397,15 +403,8 @@ protected function saveAndReplaceAdvancedPrices()
];
}
}
if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
if ($listSku) {
$this->processCountNewPrices($tierPrices);
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
$this->setUpdatedAt($listSku);
}
}
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {

if (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
->processCountNewPrices($tierPrices);

Expand All @@ -415,6 +414,17 @@ protected function saveAndReplaceAdvancedPrices()
}
}
}

if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
if ($listSku) {
$this->processCountNewPrices($tierPrices);
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
$this->setUpdatedAt($listSku);
}
}
}

return $this;
}

Expand All @@ -424,6 +434,7 @@ protected function saveAndReplaceAdvancedPrices()
* @param array $priceData
* @param string $table
* @return $this
* @throws \Exception
*/
protected function saveProductPrices(array $priceData, $table)
{
Expand Down Expand Up @@ -455,6 +466,7 @@ protected function saveProductPrices(array $priceData, $table)
* @param array $listSku
* @param string $table
* @return boolean
* @throws \Exception
*/
protected function deleteProductTierPrices(array $listSku, $table)
{
Expand Down Expand Up @@ -532,6 +544,7 @@ protected function getCustomerGroupId($customerGroup)
* Retrieve product skus
*
* @return array
* @throws \Exception
*/
protected function retrieveOldSkus()
{
Expand All @@ -552,6 +565,7 @@ protected function retrieveOldSkus()
* @param array $prices
* @param string $table
* @return $this
* @throws \Exception
*/
protected function processCountExistingPrices($prices, $table)
{
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,27 +169,27 @@
</group>
<group id="js" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
<label>JavaScript Settings</label>
<field id="merge_files" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="merge_files" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Merge JavaScript Files</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="enable_js_bundling" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="enable_js_bundling" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Enable JavaScript Bundling</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="minify_files" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="minify_files" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Minify JavaScript Files</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Minification is not applied in developer mode.</comment>
</field>
</group>
<group id="css" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1">
<label>CSS Settings</label>
<field id="merge_css_files" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="merge_css_files" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Merge CSS Files</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="minify_files" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="minify_files" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Minify CSS Files</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Minification is not applied in developer mode.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
* See COPYING.txt for license details.
*/

/**
* Product attribute add/edit form main tab
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab;

use Magento\Backend\Block\Widget\Form\Generic;
Expand All @@ -18,6 +13,8 @@
use Magento\Framework\App\ObjectManager;

/**
* Product attribute add/edit form main tab
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -73,6 +70,7 @@ public function __construct(
* Adding product form elements for editing attribute
*
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD)
*/
protected function _prepareForm()
Expand Down Expand Up @@ -255,7 +253,7 @@ protected function _prepareForm()
}

/**
* Initialize form fileds values
* Initialize form fields values
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventory/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</type>
<type name="Magento\CatalogInventory\Observer\UpdateItemsStockUponConfigChangeObserver">
<arguments>
<argument name="resourceStock" xsi:type="object">Magento\CatalogInventory\Model\ResourceModel\Stock\Proxy</argument>
<argument name="resourceStockItem" xsi:type="object">Magento\CatalogInventory\Model\ResourceModel\Stock\Item\Proxy</argument>
</arguments>
</type>
<type name="Magento\Catalog\Model\Layer">
Expand Down
13 changes: 6 additions & 7 deletions app/code/Magento/Directory/Setup/Patch/Data/AddDataForIndia.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
use Magento\Framework\Setup\Patch\PatchVersionInterface;

/**
* Class AddDataForIndia
* @package Magento\Directory\Setup\Patch\Data
* Add Regions for India.
*/
class AddDataForIndia implements DataPatchInterface, PatchVersionInterface
{
Expand All @@ -29,7 +28,7 @@ class AddDataForIndia implements DataPatchInterface, PatchVersionInterface
private $dataInstallerFactory;

/**
* AddDataForCroatia constructor.
* AddDataForIndia constructor.
*
* @param ModuleDataSetupInterface $moduleDataSetup
* @param \Magento\Directory\Setup\DataInstallerFactory $dataInstallerFactory
Expand All @@ -43,7 +42,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function apply()
{
Expand Down Expand Up @@ -103,7 +102,7 @@ private function getDataForIndia()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getDependencies()
{
Expand All @@ -113,15 +112,15 @@ public static function getDependencies()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getVersion()
{
return '2.0.2';
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAliases()
{
Expand Down
127 changes: 127 additions & 0 deletions app/code/Magento/Directory/Setup/Patch/Data/AddDataForMexico.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Directory\Setup\Patch\Data;

use Magento\Directory\Setup\DataInstaller;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchVersionInterface;

/**
* Adds Mexican States
*/
class AddDataForMexico implements DataPatchInterface, PatchVersionInterface
{
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;

/**
* @var \Magento\Directory\Setup\DataInstallerFactory
*/
private $dataInstallerFactory;

/**
* @param ModuleDataSetupInterface $moduleDataSetup
* @param \Magento\Directory\Setup\DataInstallerFactory $dataInstallerFactory
*/
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
\Magento\Directory\Setup\DataInstallerFactory $dataInstallerFactory
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->dataInstallerFactory = $dataInstallerFactory;
}

/**
* @inheritdoc
*/
public function apply()
{
/** @var DataInstaller $dataInstaller */
$dataInstaller = $this->dataInstallerFactory->create();
$dataInstaller->addCountryRegions(
$this->moduleDataSetup->getConnection(),
$this->getDataForMexico()
);
}

/**
* Mexican states data.
*
* @return array
*/
private function getDataForMexico()
{
return [
['MX', 'AGU', 'Aguascalientes'],
['MX', 'BCN', 'Baja California'],
['MX', 'BCS', 'Baja California Sur'],
['MX', 'CAM', 'Campeche'],
['MX', 'CHP', 'Chiapas'],
['MX', 'CHH', 'Chihuahua'],
['MX', 'CMX', 'Ciudad de México'],
['MX', 'COA', 'Coahuila'],
['MX', 'COL', 'Colima'],
['MX', 'DUR', 'Durango'],
['MX', 'MEX', 'Estado de México'],
['MX', 'GUA', 'Guanajuato'],
['MX', 'GRO', 'Guerrero'],
['MX', 'HID', 'Hidalgo'],
['MX', 'JAL', 'Jalisco'],
['MX', 'MIC', 'Michoacán'],
['MX', 'MOR', 'Morelos'],
['MX', 'NAY', 'Nayarit'],
['MX', 'NLE', 'Nuevo León'],
['MX', 'OAX', 'Oaxaca'],
['MX', 'PUE', 'Puebla'],
['MX', 'QUE', 'Querétaro'],
['MX', 'ROO', 'Quintana Roo'],
['MX', 'SLP', 'San Luis Potosí'],
['MX', 'SIN', 'Sinaloa'],
['MX', 'SON', 'Sonora'],
['MX', 'TAB', 'Tabasco'],
['MX', 'TAM', 'Tamaulipas'],
['MX', 'TLA', 'Tlaxcala'],
['MX', 'VER', 'Veracruz'],
['MX', 'YUC', 'Yucatán'],
['MX', 'ZAC', 'Zacatecas']
];
}

/**
* @inheritdoc
*/
public static function getDependencies()
{
return [
InitializeDirectoryData::class,
AddDataForAustralia::class,
AddDataForCroatia::class,
AddDataForIndia::class,
];
}

/**
* @inheritdoc
*/
public static function getVersion()
{
return '2.0.4';
}

/**
* @inheritdoc
*/
public function getAliases()
{
return [];
}
}
Loading

0 comments on commit 931f2ea

Please sign in to comment.