Skip to content

Commit ac98b1f

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop
2 parents a7f03dd + 2bca2aa commit ac98b1f

File tree

1,987 files changed

+60444
-19620
lines changed

Some content is hidden

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

1,987 files changed

+60444
-19620
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ atlassian*
4848
/pub/media/import/*
4949
!/pub/media/import/.htaccess
5050
/pub/media/logo/*
51+
/pub/media/custom_options/*
52+
!/pub/media/custom_options/.htaccess
5153
/pub/media/theme/*
5254
/pub/media/theme_customization/*
5355
!/pub/media/theme_customization/.htaccess

.htaccess

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#AddType x-mapp-php5 .php
2828
#AddHandler x-mapp-php5 .php
2929

30+
############################################
31+
## enable usage of methods arguments in backtrace
32+
33+
SetEnv MAGE_DEBUG_SHOW_ARGS 1
34+
3035
############################################
3136
## default index file
3237

@@ -364,6 +369,15 @@
364369
Require all denied
365370
</IfVersion>
366371
</Files>
372+
<Files .user.ini>
373+
<IfVersion < 2.4>
374+
order allow,deny
375+
deny from all
376+
</IfVersion>
377+
<IfVersion >= 2.4>
378+
Require all denied
379+
</IfVersion>
380+
</Files>
367381

368382
# For 404s and 403s that aren't handled by the application, show plain 404 response
369383
ErrorDocument 404 /pub/errors/404.php

.htaccess.sample

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#AddType x-mapp-php5 .php
2828
#AddHandler x-mapp-php5 .php
2929

30+
############################################
31+
## enable usage of methods arguments in backtrace
32+
33+
SetEnv MAGE_DEBUG_SHOW_ARGS 1
34+
3035
############################################
3136
## default index file
3237

@@ -341,6 +346,15 @@
341346
Require all denied
342347
</IfVersion>
343348
</Files>
349+
<Files .user.ini>
350+
<IfVersion < 2.4>
351+
order allow,deny
352+
deny from all
353+
</IfVersion>
354+
<IfVersion >= 2.4>
355+
Require all denied
356+
</IfVersion>
357+
</Files>
344358

345359
# For 404s and 403s that aren't handled by the application, show plain 404 response
346360
ErrorDocument 404 /pub/errors/404.php

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ cache:
5454
- $HOME/node_modules
5555
- $HOME/yarn.lock
5656
before_install:
57-
- curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.0/elasticsearch-2.3.0.deb && sudo dpkg -i --force-confnew elasticsearch-2.3.0.deb && sudo service elasticsearch restart
5857
- ./dev/travis/before_install.sh
5958
install: composer install --no-interaction
6059
before_script: ./dev/travis/before_script.sh

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Tests:
489489
* Fixed an issue where found records in global search in Backend could not be selected via keyboard
490490
* Fixed an issue where Category menu items went out of screen when page side was reached
491491
* Fixed an issue where subcategories in menu were shown instantly when user moved mouse quickly
492-
* Fixed an issue where popup header was our of window range while creating group product
492+
* Fixed an issue where popup header was out of window range while creating group product
493493
* Fixed an issue where region field was absent in customer address form on backend for "United Kingdom" country
494494
* Fixed an ability to edit the Order from Admin panel
495495
* Fixed an issue where email could not be retrieved from \Magento\Quote\Api\Data\AddressInterface after adding an address on OnePageCheckout
@@ -626,7 +626,7 @@ Tests:
626626
* Fixed an issue where filters were not shown on product reviews report grid
627627
* Fixed an issue where second customer address was not deleted from customer account
628628
* Fixed an issue where custom options pop-up was still displayed after submit
629-
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first atempt
629+
* Fixed an issue where Second Product was not added to Shopping Cart from Wishlist at first attempt
630630
* Fixed an issue where customer invalid email message was not displayed
631631
* Fixed an issue where All Access Tokens for Customer without Tokens could not be revoked
632632
* Fixed an issue where it was impossible to add Product to Shopping Cart from shared Wishlist

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<h2>Welcome</h2>
66
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

8-
## Magento system requirements
9-
[Magento system requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).
8+
## Magento System Requirements
9+
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).
1010

1111
## Install Magento
1212

13-
* [Installation guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
13+
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
1414

15-
<h2>Contributing to the Magento 2 code base</h2>
15+
<h2>Contributing to the Magento 2 Code Base</h2>
1616
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
1717

1818
To learn about how to make a contribution, click [here][1].
@@ -39,11 +39,11 @@ Magento is thankful for any contribution that can improve our code base, documen
3939
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
4040
</a>
4141

42-
### Labels applied by the Magento team
42+
### Labels Applied by the Magento Team
4343
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
4444
Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories.
4545

46-
## Reporting security issues
46+
## Reporting Security Issues
4747

4848
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).
4949

app/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Environment initialization
99
*/
1010
error_reporting(E_ALL);
11+
stream_wrapper_unregister('phar');
1112
#ini_set('display_errors', 1);
1213

1314
/* PHP version validation */

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
namespace Magento\AdminNotification\Block\Grid\Renderer;
1010

11+
/**
12+
* Renderer class for action in the admin notifications grid
13+
*
14+
* @package Magento\AdminNotification\Block\Grid\Renderer
15+
*/
1116
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
1217
{
1318
/**
@@ -37,7 +42,9 @@ public function __construct(
3742
*/
3843
public function render(\Magento\Framework\DataObject $row)
3944
{
40-
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' .
45+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
46+
$this->escapeUrl($row->getUrl())
47+
. '">' .
4148
__('Read Details') . '</a>' : '';
4249

4350
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="notifications">
11-
<uiComponent name="notification_area"/>
11+
<uiComponent name="notification_area" aclResource="Magento_AdminNotification::show_list"/>
1212
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
1313
name="unread_system_messages"
1414
as="unread_system_messages"

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

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
185185
* @param AdvancedPricing\Validator\Website $websiteValidator
186186
* @param AdvancedPricing\Validator\TierPrice $tierPriceValidator
187187
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
188+
* @throws \Exception
188189
*/
189190
public function __construct(
190191
\Magento\Framework\Json\Helper\Data $jsonHelper,
@@ -255,6 +256,7 @@ public function getEntityTypeCode()
255256
* @param array $rowData
256257
* @param int $rowNum
257258
* @return bool
259+
* @throws \Zend_Validate_Exception
258260
*/
259261
public function validateRow(array $rowData, $rowNum)
260262
{
@@ -308,6 +310,7 @@ protected function _importData()
308310
* Save advanced pricing
309311
*
310312
* @return $this
313+
* @throws \Exception
311314
*/
312315
public function saveAdvancedPricing()
313316
{
@@ -319,6 +322,7 @@ public function saveAdvancedPricing()
319322
* Deletes Advanced price data from raw data.
320323
*
321324
* @return $this
325+
* @throws \Exception
322326
*/
323327
public function deleteAdvancedPricing()
324328
{
@@ -347,6 +351,7 @@ public function deleteAdvancedPricing()
347351
* Replace advanced pricing
348352
*
349353
* @return $this
354+
* @throws \Exception
350355
*/
351356
public function replaceAdvancedPricing()
352357
{
@@ -360,6 +365,7 @@ public function replaceAdvancedPricing()
360365
* @return $this
361366
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
362367
* @SuppressWarnings(PHPMD.NPathComplexity)
368+
* @throws \Exception
363369
*/
364370
protected function saveAndReplaceAdvancedPrices()
365371
{
@@ -368,8 +374,8 @@ protected function saveAndReplaceAdvancedPrices()
368374
$this->_cachedSkuToDelete = null;
369375
}
370376
$listSku = [];
377+
$tierPrices = [];
371378
while ($bunch = $this->_dataSourceModel->getNextBunch()) {
372-
$tierPrices = [];
373379
foreach ($bunch as $rowNum => $rowData) {
374380
if (!$this->validateRow($rowData, $rowNum)) {
375381
$this->addRowError(ValidatorInterface::ERROR_SKU_IS_EMPTY, $rowNum);
@@ -397,23 +403,28 @@ protected function saveAndReplaceAdvancedPrices()
397403
];
398404
}
399405
}
400-
if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
401-
if ($listSku) {
402-
$this->processCountNewPrices($tierPrices);
403-
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
404-
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
405-
$this->setUpdatedAt($listSku);
406-
}
407-
}
408-
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
406+
407+
if (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
409408
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
410409
->processCountNewPrices($tierPrices);
410+
411411
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
412412
if ($listSku) {
413413
$this->setUpdatedAt($listSku);
414414
}
415415
}
416416
}
417+
418+
if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
419+
if ($listSku) {
420+
$this->processCountNewPrices($tierPrices);
421+
if ($this->deleteProductTierPrices(array_unique($listSku), self::TABLE_TIER_PRICE)) {
422+
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
423+
$this->setUpdatedAt($listSku);
424+
}
425+
}
426+
}
427+
417428
return $this;
418429
}
419430

@@ -423,6 +434,7 @@ protected function saveAndReplaceAdvancedPrices()
423434
* @param array $priceData
424435
* @param string $table
425436
* @return $this
437+
* @throws \Exception
426438
*/
427439
protected function saveProductPrices(array $priceData, $table)
428440
{
@@ -454,6 +466,7 @@ protected function saveProductPrices(array $priceData, $table)
454466
* @param array $listSku
455467
* @param string $table
456468
* @return boolean
469+
* @throws \Exception
457470
*/
458471
protected function deleteProductTierPrices(array $listSku, $table)
459472
{
@@ -531,6 +544,7 @@ protected function getCustomerGroupId($customerGroup)
531544
* Retrieve product skus
532545
*
533546
* @return array
547+
* @throws \Exception
534548
*/
535549
protected function retrieveOldSkus()
536550
{
@@ -551,6 +565,7 @@ protected function retrieveOldSkus()
551565
* @param array $prices
552566
* @param string $table
553567
* @return $this
568+
* @throws \Exception
554569
*/
555570
protected function processCountExistingPrices($prices, $table)
556571
{
@@ -562,11 +577,14 @@ protected function processCountExistingPrices($prices, $table)
562577

563578
$tableName = $this->_resourceFactory->create()->getTable($table);
564579
$productEntityLinkField = $this->getProductEntityLinkField();
565-
$existingPrices = $this->_connection->fetchAssoc(
580+
$existingPrices = $this->_connection->fetchAll(
566581
$this->_connection->select()->from(
567582
$tableName,
568-
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
569-
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
583+
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
584+
)->where(
585+
$productEntityLinkField . ' IN (?)',
586+
$existProductIds
587+
)
570588
);
571589
foreach ($existingPrices as $existingPrice) {
572590
foreach ($prices as $sku => $skuPrices) {
@@ -591,8 +609,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
591609
foreach ($prices as $price) {
592610
if ($existingPrice['all_groups'] == $price['all_groups']
593611
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
612+
&& (int) $existingPrice['qty'] === (int) $price['qty']
594613
) {
595614
$this->countItemsUpdated++;
615+
continue;
596616
}
597617
}
598618
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
921921
);
922922
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
923923
$this->connection->expects($this->once())
924-
->method('fetchAssoc')
924+
->method('fetchAll')
925925
->willReturn($existingPrices);
926926
$this->connection->expects($this->once())
927927
->method('select')
@@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
930930
->method('from')
931931
->with(
932932
self::TABLE_NAME,
933-
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
933+
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
934934
)->willReturnSelf();
935935
$this->advancedPricing->expects($this->once())
936936
->method('retrieveOldSkus')

app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@
4848
</depends>
4949
</field>
5050
<!--<group id="suggestions">-->
51-
<field id="search_suggestion_enabled" translate="label comment" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
51+
<field id="search_suggestion_enabled" translate="label comment" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
5252
<label>Enable Search Suggestions</label>
5353
<comment>When you enable this option your site may slow down.</comment>
5454
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
5555
</field>
56-
<field id="search_suggestion_count" translate="label" type="text" sortOrder="71" showInDefault="1" showInWebsite="1" showInStore="1">
56+
<field id="search_suggestion_count" translate="label" type="text" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="1">
5757
<label>Search Suggestions Count</label>
5858
<depends>
5959
<field id="search_suggestion_enabled">1</field>
6060
</depends>
6161
</field>
62-
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="72" showInDefault="1" showInWebsite="1" showInStore="1">
62+
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
6363
<label>Show Results Count for Each Suggestion</label>
6464
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6565
<comment>When you enable this option your site may slow down.</comment>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="AdminAdvancedReportingSection">
10+
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
11+
</section>
12+
</sections>

0 commit comments

Comments
 (0)