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

Commit 53241b9

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento/magento2#16668: Fix missing PHPDocs hinting for AdvancedPricingImportExport module (by @mageprince) - magento/magento2#16659: [Forwardport] dev:di:info duplicates plugin info (by @coderimus) - magento/magento2#16670: [Forwardport] Removed unused class from forms less file. (by @mageprince) - magento/magento2#16664: [Forwardport] 7399-clickableOverlay-less-fix - added pointer-events rule to .modal-� (by @mageprince) - magento/magento2#16642: [Forwardport] Variable as a method parameter might be overridden by the loop (by @lfluvisotto) - magento/magento2#16600: [2.3-develop][ForwardPort] Fixed backwards incompatible change to Transport variable event parameters (by @gwharton) - magento/magento2#16640: Trim email address in newsletter, forgot password, checkout login and email to a friend form (by @gelanivishal) - magento/magento2#16607: Add spelling correction: formatedPrice to formattedPrice (by @arnoudhgz) - magento/magento2#16611: [Forwardport] Removed extra code (by @gelanivishal) - magento/magento2#16638: [Forwardport] Update checkout translations (by @JeroenVanLeusden) - magento/magento2#16635: [Forwardport] Updated SynonymGroup.xml (by @sanganinamrata) - magento/magento2#16348: [Port 2.3] Captcha: Added integration tests for checking customer login attempts cleanup (by @rogyar) - magento/magento2#16623: [Forwardport] Fix for #14593 (second try #16431) (by @mageprince) Fixed GitHub Issues: - magento/magento2#7399: Modal UI: clickableOverlay option doesn't work (reported by @thdoan) has been fixed in magento/magento2#16664 by @mageprince in 2.3-develop branch Related commits: 1. 76ae28f - magento/magento2#10210: Transport variable can not be altered in email_invoice_set_template_vars_before Event (reported by @diybook) has been fixed in magento/magento2#16600 by @gwharton in 2.3-develop branch Related commits: 1. cdbd324 - magento/magento2#6058: IE11 user login email validation fails if field has leading or trailing space (reported by @dnadle) has been fixed in magento/magento2#16640 by @gelanivishal in 2.3-develop branch Related commits: 1. 6fd1eda 2. f00c37a 3. 1888b1e 4. 0653f09 - magento/magento2#14593: Press Esc Key on modal generate a jquery UI error (reported by @apomili) has been fixed in magento/magento2#16623 by @mageprince in 2.3-develop branch Related commits: 1. 0fdc0a8 2. 07f7d83 3. 160bc5d
2 parents 37d2ab2 + 71b0040 commit 53241b9

File tree

41 files changed

+312
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+312
-57
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
104104
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
105105
* @param ImportProduct\StoreResolver $storeResolver
106106
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
107-
* @throws \Magento\Framework\Exception\LocalizedException
108107
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
109108
*/
110109
public function __construct(
@@ -193,6 +192,7 @@ protected function initTypeModels()
193192
* Export process
194193
*
195194
* @return string
195+
* @throws \Magento\Framework\Exception\LocalizedException
196196
*/
197197
public function export()
198198
{
@@ -586,8 +586,8 @@ protected function getTierPrices(array $listSku, $table)
586586
* Get Website code.
587587
*
588588
* @param int $websiteId
589-
*
590589
* @return string
590+
* @throws \Magento\Framework\Exception\LocalizedException
591591
*/
592592
protected function _getWebsiteCode(int $websiteId): string
593593
{
@@ -617,8 +617,9 @@ protected function _getWebsiteCode(int $websiteId): string
617617
*
618618
* @param int $groupId
619619
* @param int $allGroups
620-
*
621620
* @return string
621+
* @throws \Magento\Framework\Exception\LocalizedException
622+
* @throws \Magento\Framework\Exception\NoSuchEntityException
622623
*/
623624
protected function _getCustomerGroupById(
624625
int $groupId,

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
99
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
1010
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
11-
use Magento\Framework\App\ResourceConnection;
1211

1312
/**
1413
* Class AdvancedPricing
@@ -618,6 +617,7 @@ protected function processCountNewPrices(array $tierPrices)
618617
* Get product entity link field
619618
*
620619
* @return string
620+
* @throws \Exception
621621
*/
622622
private function getProductEntityLinkField()
623623
{

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct($validators = [])
2828
*
2929
* @param array $value
3030
* @return bool
31+
* @throws \Zend_Validate_Exception
3132
*/
3233
public function isValid($value)
3334
{

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@ protected function setUp()
151151
]
152152
);
153153
$this->exportConfig = $this->createMock(\Magento\ImportExport\Model\Export\Config::class);
154-
$this->productFactory = $this->createPartialMock(\Magento\Catalog\Model\ResourceModel\ProductFactory::class, [
154+
$this->productFactory = $this->createPartialMock(
155+
\Magento\Catalog\Model\ResourceModel\ProductFactory::class,
156+
[
155157
'create',
156158
'getTypeId',
157-
]);
159+
]
160+
);
158161
$this->attrSetColFactory = $this->createPartialMock(
159162
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory::class,
160163
[
@@ -185,11 +188,14 @@ protected function setUp()
185188
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver::class
186189
);
187190
$this->groupRepository = $this->createMock(\Magento\Customer\Api\GroupRepositoryInterface::class);
188-
$this->writer = $this->createPartialMock(\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class, [
189-
'setHeaderCols',
190-
'writeRow',
191-
'getContents',
192-
]);
191+
$this->writer = $this->createPartialMock(
192+
\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class,
193+
[
194+
'setHeaderCols',
195+
'writeRow',
196+
'getContents',
197+
]
198+
);
193199
$constructorMethods = [
194200
'initTypeModels',
195201
'initAttributes',
@@ -347,6 +353,7 @@ protected function tearDown()
347353
* @param $object
348354
* @param $property
349355
* @return mixed
356+
* @throws \ReflectionException
350357
*/
351358
protected function getPropertyValue($object, $property)
352359
{
@@ -362,6 +369,8 @@ protected function getPropertyValue($object, $property)
362369
* @param $object
363370
* @param $property
364371
* @param $value
372+
* @return mixed
373+
* @throws \ReflectionException
365374
*/
366375
protected function setPropertyValue(&$object, $property, $value)
367376
{

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public function isValidAddMessagesCallDataProvider()
346346
* @param object $object
347347
* @param string $property
348348
* @return mixed
349+
* @throws \ReflectionException
349350
*/
350351
protected function getPropertyValue($object, $property)
351352
{
@@ -363,6 +364,7 @@ protected function getPropertyValue($object, $property)
363364
* @param string $property
364365
* @param mixed $value
365366
* @return object
367+
* @throws \ReflectionException
366368
*/
367369
protected function setPropertyValue(&$object, $property, $value)
368370
{

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ public function testGetEntityTypeCode()
209209
* Test method validateRow against its result.
210210
*
211211
* @dataProvider validateRowResultDataProvider
212+
* @param array $rowData
213+
* @param string|null $behavior
214+
* @param bool $expectedResult
215+
* @throws \ReflectionException
212216
*/
213217
public function testValidateRowResult($rowData, $behavior, $expectedResult)
214218
{
@@ -234,6 +238,10 @@ public function testValidateRowResult($rowData, $behavior, $expectedResult)
234238
* Test method validateRow whether AddRowError is called.
235239
*
236240
* @dataProvider validateRowAddRowErrorCallDataProvider
241+
* @param array $rowData
242+
* @param string|null $behavior
243+
* @param string $error
244+
* @throws \ReflectionException
237245
*/
238246
public function testValidateRowAddRowErrorCall($rowData, $behavior, $error)
239247
{
@@ -324,6 +332,13 @@ public function testSaveAdvancedPricing()
324332
* Take into consideration different data and check relative internal calls.
325333
*
326334
* @dataProvider saveAndReplaceAdvancedPricesAppendBehaviourDataProvider
335+
* @param array $data
336+
* @param string $tierCustomerGroupId
337+
* @param string $groupCustomerGroupId
338+
* @param string $tierWebsiteId
339+
* @param string $groupWebsiteId
340+
* @param array $expectedTierPrices
341+
* @throws \ReflectionException
327342
*/
328343
public function testSaveAndReplaceAdvancedPricesAppendBehaviourDataAndCalls(
329344
$data,
@@ -956,6 +971,7 @@ public function processCountExistingPricesDataProvider()
956971
* @param $object
957972
* @param $property
958973
* @return mixed
974+
* @throws \ReflectionException
959975
*/
960976
protected function getPropertyValue($object, $property)
961977
{
@@ -972,6 +988,8 @@ protected function getPropertyValue($object, $property)
972988
* @param $object
973989
* @param $property
974990
* @param $value
991+
* @return mixed
992+
* @throws \ReflectionException
975993
*/
976994
protected function setPropertyValue(&$object, $property, $value)
977995
{
@@ -989,8 +1007,8 @@ protected function setPropertyValue(&$object, $property, $value)
9891007
* @param object $object
9901008
* @param string $method
9911009
* @param array $args
992-
*
993-
* @return mixed the method result.
1010+
* @return mixed
1011+
* @throws \ReflectionException
9941012
*/
9951013
private function invokeMethod($object, $method, $args = [])
9961014
{
@@ -1007,6 +1025,7 @@ private function invokeMethod($object, $method, $args = [])
10071025
* @param array $methods
10081026
*
10091027
* @return \PHPUnit_Framework_MockObject_MockObject
1028+
* @throws \ReflectionException
10101029
*/
10111030
private function getAdvancedPricingMock($methods = [])
10121031
{

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
534534

535535
foreach ($selections as $selection) {
536536
if ($selection->getProductId() == $optionProduct->getId()) {
537-
foreach ($options as &$option) {
538-
if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
537+
foreach ($options as $quoteItemOption) {
538+
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
539539
if ($optionUpdateFlag) {
540-
$option->setValue(intval($option->getValue()));
540+
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
541541
} else {
542-
$option->setValue($value);
542+
$quoteItemOption->setValue($value);
543543
}
544544
}
545545
}

app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ public function getOption()
105105
}
106106

107107
/**
108+
* Retrieve formatted price
109+
*
108110
* @return string
109111
*/
110-
public function getFormatedPrice()
112+
public function getFormattedPrice()
111113
{
112114
if ($option = $this->getOption()) {
113115
return $this->_formatPrice(
@@ -120,6 +122,17 @@ public function getFormatedPrice()
120122
return '';
121123
}
122124

125+
/**
126+
* @return string
127+
*
128+
* @deprecated
129+
* @see getFormattedPrice()
130+
*/
131+
public function getFormatedPrice()
132+
{
133+
return $this->getFormattedPrice();
134+
}
135+
123136
/**
124137
* Return formated price
125138
*

app/code/Magento/Catalog/Block/Product/View/Price.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Magento\Catalog\Block\Product\View;
1111

12+
use Magento\Catalog\Model\Product;
13+
1214
class Price extends \Magento\Framework\View\Element\Template
1315
{
1416
/**
@@ -37,7 +39,8 @@ public function __construct(
3739
*/
3840
public function getPrice()
3941
{
42+
/** @var Product $product */
4043
$product = $this->_coreRegistry->registry('product');
41-
return $product->getFormatedPrice();
44+
return $product->getFormattedPrice();
4245
}
4346
}

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,11 +1124,24 @@ public function getTierPrice($qty = null)
11241124
/**
11251125
* Get formatted by currency product price
11261126
*
1127-
* @return array || double
1127+
* @return array|double
1128+
*/
1129+
public function getFormattedPrice()
1130+
{
1131+
return $this->getPriceModel()->getFormattedPrice($this);
1132+
}
1133+
1134+
/**
1135+
* Get formatted by currency product price
1136+
*
1137+
* @return array|double
1138+
*
1139+
* @deprecated
1140+
* @see getFormattedPrice()
11281141
*/
11291142
public function getFormatedPrice()
11301143
{
1131-
return $this->getPriceModel()->getFormatedPrice($this);
1144+
return $this->getFormattedPrice();
11321145
}
11331146

11341147
/**

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

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,15 @@ public function getTierPriceCount($product)
474474
*
475475
* @param float $qty
476476
* @param Product $product
477+
*
477478
* @return array|float
478479
*/
479-
public function getFormatedTierPrice($qty, $product)
480+
public function getFormattedTierPrice($qty, $product)
480481
{
481482
$price = $product->getTierPrice($qty);
482483
if (is_array($price)) {
483484
foreach (array_keys($price) as $index) {
484-
$price[$index]['formated_price'] = $this->priceCurrency->convertAndFormat(
485+
$price[$index]['formatted_price'] = $this->priceCurrency->convertAndFormat(
485486
$price[$index]['website_price']
486487
);
487488
}
@@ -492,15 +493,45 @@ public function getFormatedTierPrice($qty, $product)
492493
return $price;
493494
}
494495

496+
/**
497+
* Get formatted by currency tier price
498+
*
499+
* @param float $qty
500+
* @param Product $product
501+
*
502+
* @return array|float
503+
*
504+
* @deprecated
505+
* @see getFormattedTierPrice()
506+
*/
507+
public function getFormatedTierPrice($qty, $product)
508+
{
509+
return $this->getFormattedTierPrice($qty, $product);
510+
}
511+
512+
/**
513+
* Get formatted by currency product price
514+
*
515+
* @param Product $product
516+
* @return array|float
517+
*/
518+
public function getFormattedPrice($product)
519+
{
520+
return $this->priceCurrency->format($product->getFinalPrice());
521+
}
522+
495523
/**
496524
* Get formatted by currency product price
497525
*
498526
* @param Product $product
499527
* @return array || float
528+
*
529+
* @deprecated
530+
* @see getFormattedPrice()
500531
*/
501532
public function getFormatedPrice($product)
502533
{
503-
return $this->priceCurrency->format($product->getFinalPrice());
534+
return $this->getFormattedPrice($product);
504535
}
505536

506537
/**

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="admin__field field<?php if ($_option->getIsRequire()) echo ' required _required' ?>">
1414
<label class="label admin__field-label">
1515
<?= $block->escapeHtml($_option->getTitle()) ?>
16-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
16+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
1717
</label>
1818
<div class="admin__field-control control">
1919

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10+
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\File */ ?>
1011
<?php $_option = $block->getOption(); ?>
1112
<?php $_fileInfo = $block->getFileInfo(); ?>
1213
<?php $_fileExists = $_fileInfo->hasData() ? true : false; ?>
@@ -64,7 +65,7 @@ require(['prototype'], function(){
6465
<div class="admin__field <?php if ($_option->getIsRequire()) echo ' required _required' ?>">
6566
<label class="admin__field-label label">
6667
<?= $block->escapeHtml($_option->getTitle()) ?>
67-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
68+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
6869
</label>
6970
<div class="admin__field-control control">
7071
<?php if ($_fileExists): ?>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/text.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="field admin__field<?php if ($_option->getIsRequire()) echo ' required _required' ?>">
1313
<label class="admin__field-label label">
1414
<?= $block->escapeHtml($_option->getTitle()) ?>
15-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
15+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
1616
</label>
1717
<div class="control admin__field-control">
1818
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_FIELD): ?>

0 commit comments

Comments
 (0)