Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
magento-engcom-team authored Feb 25, 2019
2 parents 250045e + f112a05 commit 16036cd
Show file tree
Hide file tree
Showing 22 changed files with 262 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/
define([
'ko',
'underscore'
'underscore',
'domReady!'
], function (ko, _) {
'use strict';

Expand Down
9 changes: 0 additions & 9 deletions app/code/Magento/Customer/Block/Form/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ public function __construct(
$this->_customerSession = $customerSession;
}

/**
* @return $this
*/
protected function _prepareLayout()
{
$this->pageConfig->getTitle()->set(__('Customer Login'));
return parent::_prepareLayout();
}

/**
* Retrieve form posting url
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Customer Login</title>
</head>
<body>
<referenceContainer name="content">
<!-- customer.form.login.extra -->
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Eav/Model/Attribute/Data/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function _validateByRules($value)
return $this->_fileValidator->getMessages();
}

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

Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Marketplace/Block/Partners.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
namespace Magento\Marketplace\Block;

/**
* Partners section block.
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -39,7 +41,7 @@ public function __construct(
/**
* Gets partners
*
* @return bool|string
* @return array
*/
public function getPartners()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/**
* @var $block \Magento\OfflinePayments\Block\Info\Checkmo
*/
?>
<?= $block->escapeHtml($block->getMethod()->getTitle()) ?>
{{pdf_row_separator}}
<?php if ($block->getInfo()->getAdditionalInformation()): ?>
{{pdf_row_separator}}
<?php if ($block->getPayableTo()): ?>
<?= $block->escapeHtml(__('Make Check payable to: %1', $block->getPayableTo())) ?>
{{pdf_row_separator}}
<?php endif; ?>
<?php if ($block->getMailingAddress()): ?>
<?= $block->escapeHtml(__('Send Check to:')) ?>
{{pdf_row_separator}}
<?= /* @noEscape */ nl2br($block->escapeHtml($block->getMailingAddress())) ?>
{{pdf_row_separator}}
<?php endif; ?>
<?php endif; ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @var $block \Magento\OfflinePayments\Block\Info\Purchaseorder
*/
?>
<?= $block->escapeHtml(__('Purchase Order Number: %1', $block->getInfo()->getPoNumber())) ?>
{{pdf_row_separator}}
6 changes: 4 additions & 2 deletions app/code/Magento/PageCache/Model/Cache/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Zend\Uri\Uri;
use Zend\Uri\UriFactory;

/**
* Cache server model.
*/
class Server
{
/**
Expand Down Expand Up @@ -62,8 +65,7 @@ public function getUris()
foreach ($configuredHosts as $host) {
$servers[] = UriFactory::factory('')
->setHost($host['host'])
->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT)
;
->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT);
}
} elseif ($this->request->getHttpHost()) {
$servers[] = UriFactory::factory('')->setHost($this->request->getHttpHost())->setPort(self::DEFAULT_PORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function beforeSave()
throw new LocalizedException(
new Phrase(
'Access List value "%1" is not valid. '
.'Please use only IP addresses and host names.',
. 'Please use only IP addresses and host names.',
[$value]
)
);
Expand Down
12 changes: 9 additions & 3 deletions app/code/Magento/PageCache/Model/Varnish/VclGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Magento\PageCache\Model\VclGeneratorInterface;
use Magento\PageCache\Model\VclTemplateLocatorInterface;

/**
* Varnish vcl generator model.
*/
class VclGenerator implements VclGeneratorInterface
{
/**
Expand Down Expand Up @@ -119,7 +122,7 @@ private function getReplacements()
private function getRegexForDesignExceptions()
{
$result = '';
$tpl = "%s (req.http.user-agent ~ \"%s\") {\n"." hash_data(\"%s\");\n"." }";
$tpl = "%s (req.http.user-agent ~ \"%s\") {\n" . " hash_data(\"%s\");\n" . " }";

$expressions = $this->getDesignExceptions();

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

/**
* Get IPs access list that can purge Varnish configuration for config file generation
* and transform it to appropriate view
*
* Tansform it to appropriate view
*
* acl purge{
* "127.0.0.1";
Expand All @@ -157,7 +161,7 @@ private function getTransformedAccessList()
$result = array_reduce(
$this->getAccessList(),
function ($ips, $ip) use ($tpl) {
return $ips.sprintf($tpl, trim($ip)) . "\n";
return $ips . sprintf($tpl, trim($ip)) . "\n";
},
''
);
Expand Down Expand Up @@ -216,6 +220,8 @@ private function getSslOffloadedHeader()
}

/**
* Get design exceptions array.
*
* @return array
*/
private function getDesignExceptions()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/**
* @see \Magento\Payment\Block\Info
* @var \Magento\Payment\Block\Info $block
*/
?>
<?= $block->escapeHtml($block->getMethod()->getTitle()) ?>{{pdf_row_separator}}

<?php if ($specificInfo = $block->getSpecificInformation()):?>
<?php foreach ($specificInfo as $label => $value):?>
<?= $block->escapeHtml($label) ?>:
<?= $block->escapeHtml(implode(' ', $block->getValueAsArray($value))) ?>
{{pdf_row_separator}}
<?php endforeach; ?>
<?php endif;?>

<?= $block->escapeHtml(implode('{{pdf_row_separator}}', $block->getChildPdfAsArray())) ?>
2 changes: 2 additions & 0 deletions app/code/Magento/Sales/Model/AdminOrder/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\Model\Cart\CartInterface
Expand Down Expand Up @@ -582,6 +583,7 @@ public function initFromOrder(\Magento\Sales\Model\Order $order)
}

$quote->getShippingAddress()->unsCachedItemsAll();
$quote->getBillingAddress()->unsCachedItemsAll();
$quote->setTotalsCollectedFlag(false);

$this->quoteRepository->save($quote);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ define([
'Magento_Ui/js/form/element/abstract',
'mage/backend/notification',
'mage/translate',
'jquery/file-uploader'
'jquery/file-uploader',
'mage/adminhtml/tools'
], function ($, _, utils, uiAlert, validator, Element, notification, $t) {
'use strict';

Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Variable/view/adminhtml/web/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ define([
'Magento_Variable/js/custom-directive-generator',
'Magento_Ui/js/lib/spinner',
'jquery/ui',
'prototype'
'prototype',
'mage/adminhtml/tools'
], function (jQuery, notification, $t, wysiwyg, registry, mageApply, utils, configGenerator, customGenerator, loader) {
'use strict';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
.lib-css(color, @attr-swatch-option__color);

&.selected {
.lib-css(blackground, @attr-swatch-option__selected__background);
.lib-css(background, @attr-swatch-option__selected__background);
.lib-css(border, @attr-swatch-option__selected__border);
.lib-css(color, @attr-swatch-option__selected__color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@
}
}
}

/**
* @codingStandardsIgnoreStart
*/
#po_number {
margin-bottom: 20px;
}
// @codingStandardsIgnoreEnd
}

.payment-method-title {
Expand Down Expand Up @@ -116,7 +119,8 @@
margin: 0 0 @indent__base;

.primary {
.action-update {
.action-update {
margin-bottom: 20px;
margin-right: 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
.lib-vendor-prefix-flex-grow(1);
}

.page-main {
> .page-title-wrapper {
.page-title {
word-break: break-all;
}
}
}

//
// Header
// ---------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php declare(strict_types=1);
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Framework\Code\Generator;

use Magento\Framework\Code\Generator;
use Magento\Framework\Logger\Monolog as MagentoMonologLogger;
use Magento\TestFramework\ObjectManager;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
use Psr\Log\LoggerInterface;

class AutoloaderTest extends TestCase
{
/**
* This method exists to fix the wrong return type hint on \Magento\Framework\App\ObjectManager::getInstance.
* This way the IDE knows it's dealing with an instance of \Magento\TestFramework\ObjectManager and
* not \Magento\Framework\App\ObjectManager. The former has the method addSharedInstance, the latter does not.
*
* @return ObjectManager|\Magento\Framework\App\ObjectManager
* @SuppressWarnings(PHPMD.StaticAccess)
*/
private function getTestFrameworkObjectManager()
{
return ObjectManager::getInstance();
}

/**
* @before
*/
public function setupLoggerTestDouble(): void
{
$loggerTestDouble = $this->createMock(LoggerInterface::class);
$this->getTestFrameworkObjectManager()->addSharedInstance($loggerTestDouble, MagentoMonologLogger::class);
}

/**
* @after
*/
public function removeLoggerTestDouble(): void
{
$this->getTestFrameworkObjectManager()->removeSharedInstance(MagentoMonologLogger::class);
}

/**
* @param \RuntimeException $testException
* @return Generator|MockObject
*/
private function createExceptionThrowingGeneratorTestDouble(\RuntimeException $testException)
{
/** @var Generator|MockObject $generatorStub */
$generatorStub = $this->createMock(Generator::class);
$generatorStub->method('generateClass')->willThrowException($testException);

return $generatorStub;
}

public function testLogsExceptionDuringGeneration(): void
{
$exceptionMessage = 'Test exception thrown during generation';
$testException = new \RuntimeException($exceptionMessage);

$loggerMock = ObjectManager::getInstance()->get(LoggerInterface::class);
$loggerMock->expects($this->once())->method('debug')->with($exceptionMessage, ['exception' => $testException]);

$autoloader = new Autoloader($this->createExceptionThrowingGeneratorTestDouble($testException));
$this->assertNull($autoloader->load(NonExistingClassName::class));
}

public function testFiltersDuplicateExceptionMessages(): void
{
$exceptionMessage = 'Test exception thrown during generation';
$testException = new \RuntimeException($exceptionMessage);

$loggerMock = ObjectManager::getInstance()->get(LoggerInterface::class);
$loggerMock->expects($this->once())->method('debug')->with($exceptionMessage, ['exception' => $testException]);

$autoloader = new Autoloader($this->createExceptionThrowingGeneratorTestDouble($testException));
$autoloader->load(OneNonExistingClassName::class);
$autoloader->load(AnotherNonExistingClassName::class);
}
}
Loading

0 comments on commit 16036cd

Please sign in to comment.