Skip to content

Commit 16036cd

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Accepted Public Pull Requests: - #21368: Css property name issue (by @amol2jcommerce) - #21360: Solve #21359 Search with long string display horizontal scroll in front end (by @mageprince) - #21328: Issue Fixed #21322 : Declarative schema: Omitting indexType throws exception (by @milindsingh) - #21347: Applied PHP-CS-Fixer for code cleanup. (by @yogeshsuhagiya) - #21335: Fixed #15059 Cannot reorder from the first try (by @shikhamis11) - #21045: Update static block in nginx.conf.sample (by @jaideepghosh) - #19988: Fix for issue 19983 Can't upload customer Image attribute programmatically (by @Nazar65) - #20950: #20773: Do not throw exception during autoload (by @Vinai) - #20583: 13982 customer login block sets the title for the page when rendered (by @lisovyievhenii) - #20307: Fixed issue #20305 Update button on payment checkout is not proper alligned (by @GovindaSharma) - #18503: Checkout - Fix JS error Cannot read property 'quoteData' of undefined (by @ihor-sviziev) - #20043: Make it possible to generate sales PDF's using the API (by @AntonEvers) Fixed GitHub Issues: - #21365: CSS Property name issue (reported by @klierik) has been fixed in #21368 by @amol2jcommerce in 2.3-develop branch Related commits: 1. f669a4d 2. ac8b808 3. 40a6274 4. 2123f2f 5. 9a0c504 6. a68e815 - #21359: Search with long string display horizontal scroll in front end (reported by @mageprince) has been fixed in #21360 by @mageprince in 2.3-develop branch Related commits: 1. b63123e 2. 1236770 - #21322: Declarative schema: Omitting indexType throws exception (reported by @k4emic) has been fixed in #21328 by @milindsingh in 2.3-develop branch Related commits: 1. b179e54 - #15059: Cannot reorder from the first try (reported by @TomashKhamlai) has been fixed in #21335 by @shikhamis11 in 2.3-develop branch Related commits: 1. 3e83284 2. 124b0e0 - #19983: Can't work customer Image attribute programmatically (reported by @cygnetampatel) has been fixed in #19988 by @Nazar65 in 2.3-develop branch Related commits: 1. 6d5ee63 2. 188a3e6 3. 20fd589 4. 9ca8077 5. a051656 6. 1372203 7. acc98ec - #20773: The autoloader throws an exception on class_exists (reported by @sidolov) has been fixed in #20950 by @Vinai in 2.3-develop branch Related commits: 1. cab38a2 2. cfbf8c9 3. 9d3bc18 - #13982: Customer Login Block sets the title for the page when rendered (reported by @matthew-muscat) has been fixed in #20583 by @lisovyievhenii in 2.3-develop branch Related commits: 1. 122e5c2 2. 93f1caa - #20305: Update button on payment checkout is not proper alligned (reported by @mohammadzakir) has been fixed in #20307 by @GovindaSharma in 2.3-develop branch Related commits: 1. 99d6e43 2. da46b6a 3. 1d1bb33 - #14412: Magento 2.2.3 TypeErrors Cannot read property 'quoteData' / 'storecode' / 'sectionLoadUrl' of undefined (reported by @bramulous) has been fixed in #18503 by @ihor-sviziev in 2.3-develop branch Related commits: 1. 96687ac
2 parents 250045e + f112a05 commit 16036cd

File tree

22 files changed

+262
-38
lines changed

22 files changed

+262
-38
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/quote.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
*/
88
define([
99
'ko',
10-
'underscore'
10+
'underscore',
11+
'domReady!'
1112
], function (ko, _) {
1213
'use strict';
1314

app/code/Magento/Customer/Block/Form/Login.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ public function __construct(
4747
$this->_customerSession = $customerSession;
4848
}
4949

50-
/**
51-
* @return $this
52-
*/
53-
protected function _prepareLayout()
54-
{
55-
$this->pageConfig->getTitle()->set(__('Customer Login'));
56-
return parent::_prepareLayout();
57-
}
58-
5950
/**
6051
* Retrieve form posting url
6152
*

app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<head>
10+
<title>Customer Login</title>
11+
</head>
912
<body>
1013
<referenceContainer name="content">
1114
<!-- customer.form.login.extra -->

app/code/Magento/Eav/Model/Attribute/Data/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected function _validateByRules($value)
146146
return $this->_fileValidator->getMessages();
147147
}
148148

149-
if (empty($value['tmp_name'])) {
149+
if (!empty($value['tmp_name']) && !file_exists($value['tmp_name'])) {
150150
return [__('"%1" is not a valid file.', $label)];
151151
}
152152

app/code/Magento/Marketplace/Block/Partners.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
namespace Magento\Marketplace\Block;
88

99
/**
10+
* Partners section block.
11+
*
1012
* @api
1113
* @since 100.0.2
1214
*/
@@ -39,7 +41,7 @@ public function __construct(
3941
/**
4042
* Gets partners
4143
*
42-
* @return bool|string
44+
* @return array
4345
*/
4446
public function getPartners()
4547
{
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
// @codingStandardsIgnoreFile
8+
/**
9+
* @var $block \Magento\OfflinePayments\Block\Info\Checkmo
10+
*/
11+
?>
12+
<?= $block->escapeHtml($block->getMethod()->getTitle()) ?>
13+
{{pdf_row_separator}}
14+
<?php if ($block->getInfo()->getAdditionalInformation()): ?>
15+
{{pdf_row_separator}}
16+
<?php if ($block->getPayableTo()): ?>
17+
<?= $block->escapeHtml(__('Make Check payable to: %1', $block->getPayableTo())) ?>
18+
{{pdf_row_separator}}
19+
<?php endif; ?>
20+
<?php if ($block->getMailingAddress()): ?>
21+
<?= $block->escapeHtml(__('Send Check to:')) ?>
22+
{{pdf_row_separator}}
23+
<?= /* @noEscape */ nl2br($block->escapeHtml($block->getMailingAddress())) ?>
24+
{{pdf_row_separator}}
25+
<?php endif; ?>
26+
<?php endif; ?>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
/**
7+
* @var $block \Magento\OfflinePayments\Block\Info\Purchaseorder
8+
*/
9+
?>
10+
<?= $block->escapeHtml(__('Purchase Order Number: %1', $block->getInfo()->getPoNumber())) ?>
11+
{{pdf_row_separator}}

app/code/Magento/PageCache/Model/Cache/Server.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Zend\Uri\Uri;
1313
use Zend\Uri\UriFactory;
1414

15+
/**
16+
* Cache server model.
17+
*/
1518
class Server
1619
{
1720
/**
@@ -62,8 +65,7 @@ public function getUris()
6265
foreach ($configuredHosts as $host) {
6366
$servers[] = UriFactory::factory('')
6467
->setHost($host['host'])
65-
->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT)
66-
;
68+
->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT);
6769
}
6870
} elseif ($this->request->getHttpHost()) {
6971
$servers[] = UriFactory::factory('')->setHost($this->request->getHttpHost())->setPort(self::DEFAULT_PORT);

app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function beforeSave()
2828
throw new LocalizedException(
2929
new Phrase(
3030
'Access List value "%1" is not valid. '
31-
.'Please use only IP addresses and host names.',
31+
. 'Please use only IP addresses and host names.',
3232
[$value]
3333
)
3434
);

app/code/Magento/PageCache/Model/Varnish/VclGenerator.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\PageCache\Model\VclGeneratorInterface;
1010
use Magento\PageCache\Model\VclTemplateLocatorInterface;
1111

12+
/**
13+
* Varnish vcl generator model.
14+
*/
1215
class VclGenerator implements VclGeneratorInterface
1316
{
1417
/**
@@ -119,7 +122,7 @@ private function getReplacements()
119122
private function getRegexForDesignExceptions()
120123
{
121124
$result = '';
122-
$tpl = "%s (req.http.user-agent ~ \"%s\") {\n"." hash_data(\"%s\");\n"." }";
125+
$tpl = "%s (req.http.user-agent ~ \"%s\") {\n" . " hash_data(\"%s\");\n" . " }";
123126

124127
$expressions = $this->getDesignExceptions();
125128

@@ -143,7 +146,8 @@ private function getRegexForDesignExceptions()
143146

144147
/**
145148
* Get IPs access list that can purge Varnish configuration for config file generation
146-
* and transform it to appropriate view
149+
*
150+
* Tansform it to appropriate view
147151
*
148152
* acl purge{
149153
* "127.0.0.1";
@@ -157,7 +161,7 @@ private function getTransformedAccessList()
157161
$result = array_reduce(
158162
$this->getAccessList(),
159163
function ($ips, $ip) use ($tpl) {
160-
return $ips.sprintf($tpl, trim($ip)) . "\n";
164+
return $ips . sprintf($tpl, trim($ip)) . "\n";
161165
},
162166
''
163167
);
@@ -216,6 +220,8 @@ private function getSslOffloadedHeader()
216220
}
217221

218222
/**
223+
* Get design exceptions array.
224+
*
219225
* @return array
220226
*/
221227
private function getDesignExceptions()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
// @codingStandardsIgnoreFile
8+
/**
9+
* @see \Magento\Payment\Block\Info
10+
* @var \Magento\Payment\Block\Info $block
11+
*/
12+
?>
13+
<?= $block->escapeHtml($block->getMethod()->getTitle()) ?>{{pdf_row_separator}}
14+
15+
<?php if ($specificInfo = $block->getSpecificInformation()):?>
16+
<?php foreach ($specificInfo as $label => $value):?>
17+
<?= $block->escapeHtml($label) ?>:
18+
<?= $block->escapeHtml(implode(' ', $block->getValueAsArray($value))) ?>
19+
{{pdf_row_separator}}
20+
<?php endforeach; ?>
21+
<?php endif;?>
22+
23+
<?= $block->escapeHtml(implode('{{pdf_row_separator}}', $block->getChildPdfAsArray())) ?>

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @SuppressWarnings(PHPMD.TooManyFields)
2424
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
2525
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
26+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2627
* @since 100.0.2
2728
*/
2829
class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\Model\Cart\CartInterface
@@ -582,6 +583,7 @@ public function initFromOrder(\Magento\Sales\Model\Order $order)
582583
}
583584

584585
$quote->getShippingAddress()->unsCachedItemsAll();
586+
$quote->getBillingAddress()->unsCachedItemsAll();
585587
$quote->setTotalsCollectedFlag(false);
586588

587589
$this->quoteRepository->save($quote);

app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ define([
1616
'Magento_Ui/js/form/element/abstract',
1717
'mage/backend/notification',
1818
'mage/translate',
19-
'jquery/file-uploader'
19+
'jquery/file-uploader',
20+
'mage/adminhtml/tools'
2021
], function ($, _, utils, uiAlert, validator, Element, notification, $t) {
2122
'use strict';
2223

app/code/Magento/Variable/view/adminhtml/web/variables.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ define([
1616
'Magento_Variable/js/custom-directive-generator',
1717
'Magento_Ui/js/lib/spinner',
1818
'jquery/ui',
19-
'prototype'
19+
'prototype',
20+
'mage/adminhtml/tools'
2021
], function (jQuery, notification, $t, wysiwyg, registry, mageApply, utils, configGenerator, customGenerator, loader) {
2122
'use strict';
2223

app/design/frontend/Magento/blank/Magento_Swatches/web/css/source/_module.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
.lib-css(color, @attr-swatch-option__color);
115115

116116
&.selected {
117-
.lib-css(blackground, @attr-swatch-option__selected__background);
117+
.lib-css(background, @attr-swatch-option__selected__background);
118118
.lib-css(border, @attr-swatch-option__selected__border);
119119
.lib-css(color, @attr-swatch-option__selected__color);
120120
}

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@
6363
}
6464
}
6565
}
66-
66+
/**
67+
* @codingStandardsIgnoreStart
68+
*/
6769
#po_number {
6870
margin-bottom: 20px;
6971
}
72+
// @codingStandardsIgnoreEnd
7073
}
7174

7275
.payment-method-title {
@@ -116,7 +119,8 @@
116119
margin: 0 0 @indent__base;
117120

118121
.primary {
119-
.action-update {
122+
.action-update {
123+
margin-bottom: 20px;
120124
margin-right: 0;
121125
}
122126
}

app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@
7777
.lib-vendor-prefix-flex-grow(1);
7878
}
7979

80+
.page-main {
81+
> .page-title-wrapper {
82+
.page-title {
83+
word-break: break-all;
84+
}
85+
}
86+
}
87+
8088
//
8189
// Header
8290
// ---------------------------------------------
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Framework\Code\Generator;
8+
9+
use Magento\Framework\Code\Generator;
10+
use Magento\Framework\Logger\Monolog as MagentoMonologLogger;
11+
use Magento\TestFramework\ObjectManager;
12+
use PHPUnit\Framework\TestCase;
13+
use PHPUnit_Framework_MockObject_MockObject as MockObject;
14+
use Psr\Log\LoggerInterface;
15+
16+
class AutoloaderTest extends TestCase
17+
{
18+
/**
19+
* This method exists to fix the wrong return type hint on \Magento\Framework\App\ObjectManager::getInstance.
20+
* This way the IDE knows it's dealing with an instance of \Magento\TestFramework\ObjectManager and
21+
* not \Magento\Framework\App\ObjectManager. The former has the method addSharedInstance, the latter does not.
22+
*
23+
* @return ObjectManager|\Magento\Framework\App\ObjectManager
24+
* @SuppressWarnings(PHPMD.StaticAccess)
25+
*/
26+
private function getTestFrameworkObjectManager()
27+
{
28+
return ObjectManager::getInstance();
29+
}
30+
31+
/**
32+
* @before
33+
*/
34+
public function setupLoggerTestDouble(): void
35+
{
36+
$loggerTestDouble = $this->createMock(LoggerInterface::class);
37+
$this->getTestFrameworkObjectManager()->addSharedInstance($loggerTestDouble, MagentoMonologLogger::class);
38+
}
39+
40+
/**
41+
* @after
42+
*/
43+
public function removeLoggerTestDouble(): void
44+
{
45+
$this->getTestFrameworkObjectManager()->removeSharedInstance(MagentoMonologLogger::class);
46+
}
47+
48+
/**
49+
* @param \RuntimeException $testException
50+
* @return Generator|MockObject
51+
*/
52+
private function createExceptionThrowingGeneratorTestDouble(\RuntimeException $testException)
53+
{
54+
/** @var Generator|MockObject $generatorStub */
55+
$generatorStub = $this->createMock(Generator::class);
56+
$generatorStub->method('generateClass')->willThrowException($testException);
57+
58+
return $generatorStub;
59+
}
60+
61+
public function testLogsExceptionDuringGeneration(): void
62+
{
63+
$exceptionMessage = 'Test exception thrown during generation';
64+
$testException = new \RuntimeException($exceptionMessage);
65+
66+
$loggerMock = ObjectManager::getInstance()->get(LoggerInterface::class);
67+
$loggerMock->expects($this->once())->method('debug')->with($exceptionMessage, ['exception' => $testException]);
68+
69+
$autoloader = new Autoloader($this->createExceptionThrowingGeneratorTestDouble($testException));
70+
$this->assertNull($autoloader->load(NonExistingClassName::class));
71+
}
72+
73+
public function testFiltersDuplicateExceptionMessages(): void
74+
{
75+
$exceptionMessage = 'Test exception thrown during generation';
76+
$testException = new \RuntimeException($exceptionMessage);
77+
78+
$loggerMock = ObjectManager::getInstance()->get(LoggerInterface::class);
79+
$loggerMock->expects($this->once())->method('debug')->with($exceptionMessage, ['exception' => $testException]);
80+
81+
$autoloader = new Autoloader($this->createExceptionThrowingGeneratorTestDouble($testException));
82+
$autoloader->load(OneNonExistingClassName::class);
83+
$autoloader->load(AnotherNonExistingClassName::class);
84+
}
85+
}

0 commit comments

Comments
 (0)