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:
 - #18856: Fixed - Downloadable products - Downloadable Information - Link design issue  (by @speedy008)
 - #18897: Remove duplicated CSS selector (by @dmytro-ch)
 - #18889: fixed Translation issue send-friend in send.phtml (by @rahulwebkul)
 - #18851: Fixes theme header logo and icon upload (by @wiardvanrij)
 - #18844: Resolves 6731 by adding a custom message for refunding shipping (by @Rus0)
 - #18846: Fix for Invalid Unit Test Annotations (by @okorshenko)
 - #18798: Added form fieldset before html data to \Magento\Framework\Data\Form\Element\Fieldset in getElementHtml() method (by @vasilii-b)
 - #18774: [Forwardport] 17516: added Australian states (by @VitaliyBoyko)
 - #18700: Reload cart totals when cart data changes (by @tdgroot)
 - #18590: Fix disappearing navigation arrows in fotorama zoom (by @luukschakenraad)
 - #18419: Fix: Exception Error in Catalog Price Rule while Backend language is not English (by @Mardl)


Fixed GitHub Issues:
 - #18854: Downloadable products - Downloadable Information - Link design issue (reported by @saphaljha) has been fixed in #18856 by @speedy008 in 2.3-develop branch
   Related commits:
     1. 7401795
     2. cd97592

 - #18779: Translation issue send-friend in sendphtml (reported by @Franzld) has been fixed in #18889 by @rahulwebkul in 2.3-develop branch
   Related commits:
     1. 008fe5d
     2. 7db2cc9
     3. 0f91cb7
     4. 1c23cf9

 - #18688: Unable to upload Logo, Magento 2.3.0 Beta18 (reported by @davegog) has been fixed in #18851 by @wiardvanrij in 2.3-develop branch
   Related commits:
     1. ba69bfe

 - #6731: 'Exception' with message 'Warning: Division by zero in vendor/magento/module-sales/Model/Order/Creditmemo/Total/Discount.php on line 32' in vendor/magento/framework/App/ErrorHandler.php:61 (reported by @lsv) has been fixed in #18844 by @Rus0 in 2.3-develop branch
   Related commits:
     1. dfa2f25
     2. 4cf4884
     3. a99c24f
     4. b02dbc6
     5. d3e576f
     6. 02dc040
     7. 73af54a

 - #18840: Invalid Unit Test Annotations (reported by @okorshenko) has been fixed in #18846 by @okorshenko in 2.3-develop branch
   Related commits:
     1. 0f0f64d

 - #2618: Class \Magento\Framework\Data\Form\Element\Fieldset breaks specification of the parent class \Magento\Framework\Data\Form\Element\AbstractElement by not calling the method getBeforeElementHtml (getAfterElementHtml is called) (reported by @dmitry-fedyuk) has been fixed in #18798 by @vasilii-b in 2.3-develop branch
   Related commits:
     1. 069195c

 - #18585: Navigation arrows zoomed fotorama disappear (reported by @luukschakenraad) has been fixed in #18590 by @luukschakenraad in 2.3-develop branch
   Related commits:
     1. 96507df
     2. 623a6b0

 - #12399: Exception Error in Catalog Price Rule while Backend language is not English (reported by @Drakas) has been fixed in #18419 by @Mardl in 2.3-develop branch
   Related commits:
     1. 8f36157
     2. 0d97a16
     3. ba703d7
     4. d11ef56
  • Loading branch information
Oleksii Korshenko authored Oct 31, 2018
2 parents ec5fcb5 + 7adfb29 commit da1a96c
Show file tree
Hide file tree
Showing 30 changed files with 264 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function testGetWithNonExistingProduct()

/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
* @expectedExceptionText The image doesn't exist. Verify and try again.
* @expectedExceptionMessage The image doesn't exist. Verify and try again.
*/
public function testGetWithNonExistingImage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function setUp()

/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
* @expectedMessage Tier price is unavailable for this product.
* @expectedExceptionMessage Product hasn't group price with such data: customerGroupId = '1', website = 1, qty = 3
*/
public function testRemoveWhenTierPricesNotExists()
{
Expand All @@ -70,7 +70,7 @@ public function testRemoveWhenTierPricesNotExists()

/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
* @expectedMessage For current customerGroupId = '10' with 'qty' = 15 any tier price exist'.
* @expectedExceptionMessage Product hasn't group price with such data: customerGroupId = '10', website = 1, qty = 5
*/
public function testRemoveTierPriceForNonExistingCustomerGroup()
{
Expand All @@ -81,7 +81,7 @@ public function testRemoveTierPriceForNonExistingCustomerGroup()
->will($this->returnValue($this->prices));
$this->productMock->expects($this->never())->method('setData');
$this->productRepositoryMock->expects($this->never())->method('save');
$this->priceModifier->removeTierPrice($this->productMock, 10, 15, 1);
$this->priceModifier->removeTierPrice($this->productMock, 10, 5, 1);
}

public function testSuccessfullyRemoveTierPriceSpecifiedForAllGroups()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function testSuccessDeleteTierPrice()

/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
* @message The product doesn't exist. Verify and try again.
* @expectedExceptionMessage No such entity.
*/
public function testDeleteTierPriceFromNonExistingProduct()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Magento\Framework\App\Request\DataPersistorInterface;

/**
* Save action for catalog rule
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Save extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog implements HttpPostActionInterface
Expand All @@ -40,7 +42,9 @@ public function __construct(
}

/**
* @return void
* Execute save action from catalog rule
*
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()
Expand All @@ -61,6 +65,17 @@ public function execute()
['request' => $this->getRequest()]
);
$data = $this->getRequest()->getPostValue();

$filterValues = ['from_date' => $this->_dateFilter];
if ($this->getRequest()->getParam('to_date')) {
$filterValues['to_date'] = $this->_dateFilter;
}
$inputFilter = new \Zend_Filter_Input(
$filterValues,
[],
$data
);
$data = $inputFilter->getUnescaped();
$id = $this->getRequest()->getParam('rule_id');
if ($id) {
$model = $ruleRepository->get($id);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function testCheckQuoteItem()

/**
* @expectedException \Magento\Framework\Exception\LocalizedException
* @exceptedExceptionMessage The quote item isn't found. Verify the item and try again.
* @expectedExceptionMessage The quote item isn't found. Verify the item and try again.
*/
public function testCheckQuoteItemWithException()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,71 @@ define([
'use strict';

var rateProcessors = [],
totalsProcessors = [];
totalsProcessors = [],

quote.shippingAddress.subscribe(function () {
var type = quote.shippingAddress().getType();
/**
* Estimate totals for shipping address and update shipping rates.
*/
estimateTotalsAndUpdateRates = function () {
var type = quote.shippingAddress().getType();

if (
quote.isVirtual() ||
window.checkoutConfig.activeCarriers && window.checkoutConfig.activeCarriers.length === 0
) {
// update totals block when estimated address was set
totalsProcessors['default'] = totalsDefaultProvider;
totalsProcessors[type] ?
totalsProcessors[type].estimateTotals(quote.shippingAddress()) :
totalsProcessors['default'].estimateTotals(quote.shippingAddress());
} else {
// check if user data not changed -> load rates from cache
if (!cartCache.isChanged('address', quote.shippingAddress()) &&
!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) &&
cartCache.get('rates')
if (
quote.isVirtual() ||
window.checkoutConfig.activeCarriers && window.checkoutConfig.activeCarriers.length === 0
) {
shippingService.setShippingRates(cartCache.get('rates'));
// update totals block when estimated address was set
totalsProcessors['default'] = totalsDefaultProvider;
totalsProcessors[type] ?
totalsProcessors[type].estimateTotals(quote.shippingAddress()) :
totalsProcessors['default'].estimateTotals(quote.shippingAddress());
} else {
// check if user data not changed -> load rates from cache
if (!cartCache.isChanged('address', quote.shippingAddress()) &&
!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) &&
cartCache.get('rates')
) {
shippingService.setShippingRates(cartCache.get('rates'));

return;
return;
}

// update rates list when estimated address was set
rateProcessors['default'] = defaultProcessor;
rateProcessors[type] ?
rateProcessors[type].getRates(quote.shippingAddress()) :
rateProcessors['default'].getRates(quote.shippingAddress());

// save rates to cache after load
shippingService.getShippingRates().subscribe(function (rates) {
cartCache.set('rates', rates);
});
}
},

// update rates list when estimated address was set
rateProcessors['default'] = defaultProcessor;
rateProcessors[type] ?
rateProcessors[type].getRates(quote.shippingAddress()) :
rateProcessors['default'].getRates(quote.shippingAddress());
/**
* Estimate totals for shipping address.
*/
estimateTotalsShipping = function () {
totalsDefaultProvider.estimateTotals(quote.shippingAddress());
},

// save rates to cache after load
shippingService.getShippingRates().subscribe(function (rates) {
cartCache.set('rates', rates);
});
}
});
quote.shippingMethod.subscribe(function () {
totalsDefaultProvider.estimateTotals(quote.shippingAddress());
});
quote.billingAddress.subscribe(function () {
var type = quote.billingAddress().getType();
/**
* Estimate totals for billing address.
*/
estimateTotalsBilling = function () {
var type = quote.billingAddress().getType();

if (quote.isVirtual()) {
// update totals block when estimated address was set
totalsProcessors['default'] = totalsDefaultProvider;
totalsProcessors[type] ?
totalsProcessors[type].estimateTotals(quote.billingAddress()) :
totalsProcessors['default'].estimateTotals(quote.billingAddress());
}
};

if (quote.isVirtual()) {
// update totals block when estimated address was set
totalsProcessors['default'] = totalsDefaultProvider;
totalsProcessors[type] ?
totalsProcessors[type].estimateTotals(quote.billingAddress()) :
totalsProcessors['default'].estimateTotals(quote.billingAddress());
}
});
quote.shippingAddress.subscribe(estimateTotalsAndUpdateRates);
quote.shippingMethod.subscribe(estimateTotalsShipping);
quote.billingAddress.subscribe(estimateTotalsBilling);
customerData.get('cart').subscribe(estimateTotalsShipping);
});
102 changes: 102 additions & 0 deletions app/code/Magento/Directory/Setup/Patch/Data/AddDataForAustralia.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?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 Australian States
*/
class AddDataForAustralia 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->getDataForAustralia()
);
}

/**
* Australian states data.
*
* @return array
*/
private function getDataForAustralia()
{
return [
['AU', 'ACT', 'Australian Capital Territory'],
['AU', 'NSW', 'New South Wales'],
['AU', 'VIC', 'Victoria'],
['AU', 'QLD', 'Queensland'],
['AU', 'SA', 'South Australia'],
['AU', 'TAS', 'Tasmania'],
['AU', 'WA', 'Western Australia'],
['AU', 'NT', 'Northern Territory']
];
}

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

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

/**
* @inheritdoc
*/
public function getAliases()
{
return [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testSetResourceInvalidPath()

/**
* @expectedException \Magento\Framework\Exception\LocalizedException
* @exectedExceptionMessage Please set resource file and link type.
* @expectedExceptionMessage Please set resource file and link type.
*/
public function testGetFileSizeNoResource()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function testAfterSaveGiftMessages()

/**
* @expectedException \Magento\Framework\Exception\CouldNotSaveException
* @expectedMessage The gift message couldn't be added to the "Test message" order.
* @expectedExceptionMessage The gift message couldn't be added to the "Test message" order.
*/
public function testAfterSaveIfGiftMessagesNotExist()
{
Expand All @@ -146,7 +146,7 @@ public function testAfterSaveIfGiftMessagesNotExist()
$this->giftMessageOrderRepositoryMock
->expects($this->once())
->method('save')
->willThrowException(new \Exception('TestMessage'));
->willThrowException(new \Exception('Test message'));

// save Gift Messages on item level
$this->orderMock->expects($this->never())->method('getItems');
Expand All @@ -155,7 +155,7 @@ public function testAfterSaveIfGiftMessagesNotExist()

/**
* @expectedException \Magento\Framework\Exception\CouldNotSaveException
* @expectedMessage The gift message couldn't be added to the "Test message" order.
* @expectedExceptionMessage The gift message couldn't be added to the "Test message" order item.
*/
public function testAfterSaveIfItemGiftMessagesNotExist()
{
Expand Down Expand Up @@ -185,7 +185,7 @@ public function testAfterSaveIfItemGiftMessagesNotExist()
$this->giftMessageOrderItemRepositoryMock
->expects($this->once())->method('save')
->with($orderId, $orderItemId, $this->giftMessageMock)
->willThrowException(new \Exception('TestMessage'));
->willThrowException(new \Exception('Test message'));
$this->plugin->afterSave($this->orderRepositoryMock, $this->orderMock);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function setUp()

/**
* @expectedException \Magento\Framework\Exception\StateException
* @expectedMessage You don't have the correct permissions to assign the customer to the cart.
* @expectedExceptionMessage You don't have the correct permissions to assign the customer to the cart.
*/
public function testBeforeAssignCustomer()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function setUp()

/**
* @expectedException \InvalidArgumentException
* @ExceptedExceptionMessage The qty value is required to update quote item.
* @expectedExceptionMessage The qty value is required to update quote item.
*/
public function testUpdateNoQty()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function setUp()

/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
* @expected ExceptionMessage error345
* @expectedExceptionMessage error345
*/
public function testSetAddressValidationFailed()
{
Expand Down
Loading

0 comments on commit da1a96c

Please sign in to comment.