Skip to content

Commit

Permalink
merge magento/2.3-develop into magento-epam/EPAM-PR-66
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-cicd2 authored Aug 20, 2019
2 parents de50b34 + a9a32dc commit 5c5978a
Show file tree
Hide file tree
Showing 16 changed files with 122 additions and 51 deletions.
2 changes: 2 additions & 0 deletions app/code/Magento/Catalog/Block/Product/ImageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ public function create(Product $product, string $imageId, array $attributes = nu
);
}

$attributes = $attributes === null ? [] : $attributes;

$data = [
'data' => [
'template' => 'Magento_Catalog::product/image_with_borders.phtml',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@
</assertEquals>
<moveMouseOver selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="hoverProduct"/>
<waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd:nth-child(2)" stepKey="waitForCustomOptionValueFullName"/>
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj111 11Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/>
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,13 @@
<?= $block->getChildHtml('form_bottom') ?>
</form>
</div>
<script>
require([
'jquery',
'priceBox'
], function($){
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?= $block->escapeHtml($_product->getId()) ?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem){
return !$(elem).find('.price-from').length;
});

priceBoxes.priceBox({'priceConfig': <?= /* @noEscape */ $block->getJsonConfig() ?>});
});
<script type="text/x-magento-init">
{
"[data-role=priceBox][data-price-box=product-id-<?= $block->escapeHtml($_product->getId()) ?>]": {
"priceBox": {
"priceConfig": <?= /* @noEscape */ $block->getJsonConfig() ?>
}
}
}
</script>
13 changes: 7 additions & 6 deletions app/code/Magento/Customer/Controller/Account/CreatePost.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Customer\Controller\Account;

use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository;
Expand Down Expand Up @@ -349,15 +351,14 @@ public function execute()
$confirmation = $this->getRequest()->getParam('password_confirmation');
$redirectUrl = $this->session->getBeforeAuthUrl();
$this->checkPasswordConfirmation($password, $confirmation);

$extensionAttributes = $customer->getExtensionAttributes();
$extensionAttributes->setIsSubscribed($this->getRequest()->getParam('is_subscribed', false));
$customer->setExtensionAttributes($extensionAttributes);

$customer = $this->accountManagement
->createAccount($customer, $password, $redirectUrl);

if ($this->getRequest()->getParam('is_subscribed', false)) {
$extensionAttributes = $customer->getExtensionAttributes();
$extensionAttributes->setIsSubscribed(true);
$customer->setExtensionAttributes($extensionAttributes);
$this->customerRepository->save($customer);
}
$this->_eventManager->dispatch(
'customer_register_success',
['account_controller' => $this, 'customer' => $customer]
Expand Down
29 changes: 20 additions & 9 deletions app/code/Magento/Eav/Model/ResourceModel/ReadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Eav\Model\ResourceModel;

use Exception;
use Magento\Eav\Model\Config;
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
use Magento\Framework\DataObject;
use Magento\Framework\DB\Select;
use Magento\Framework\DB\Sql\UnionExpression;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\EntityManager\Operation\AttributeInterface;
use Magento\Framework\Exception\ConfigurationMismatchException;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Model\Entity\ScopeInterface;
use Magento\Framework\Model\Entity\ScopeResolver;
use Psr\Log\LoggerInterface;

/**
* EAV read handler
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ReadHandler implements AttributeInterface
{
Expand Down Expand Up @@ -63,7 +70,7 @@ public function __construct(
*
* @param string $entityType
* @return \Magento\Eav\Api\Data\AttributeInterface[]
* @throws \Exception if for unknown entity type
* @throws Exception if for unknown entity type
* @deprecated Not used anymore
* @see ReadHandler::getEntityAttributes
*/
Expand All @@ -80,7 +87,7 @@ protected function getAttributes($entityType)
* @param string $entityType
* @param DataObject $entity
* @return \Magento\Eav\Api\Data\AttributeInterface[]
* @throws \Exception if for unknown entity type
* @throws Exception if for unknown entity type
*/
private function getEntityAttributes(string $entityType, DataObject $entity): array
{
Expand Down Expand Up @@ -111,9 +118,9 @@ protected function getContextVariables(ScopeInterface $scope)
* @param array $entityData
* @param array $arguments
* @return array
* @throws \Exception
* @throws \Magento\Framework\Exception\ConfigurationMismatchException
* @throws \Magento\Framework\Exception\LocalizedException
* @throws Exception
* @throws ConfigurationMismatchException
* @throws LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function execute($entityType, $entityData, $arguments = [])
Expand All @@ -129,7 +136,7 @@ public function execute($entityType, $entityData, $arguments = [])
$attributesMap = [];
$selects = [];

/** @var \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute */
/** @var AbstractAttribute $attribute */
foreach ($this->getEntityAttributes($entityType, new DataObject($entityData)) as $attribute) {
if (!$attribute->isStatic()) {
$attributeTables[$attribute->getBackend()->getTable()][] = $attribute->getAttributeId();
Expand Down Expand Up @@ -170,8 +177,11 @@ public function execute($entityType, $entityData, $arguments = [])
$entityData[$attributesMap[$attributeValue['attribute_id']]] = $attributeValue['value'];
} else {
$this->logger->warning(
"Attempt to load value of nonexistent EAV attribute '{$attributeValue['attribute_id']}'
for entity type '$entityType'."
"Attempt to load value of nonexistent EAV attribute",
[
'attribute_id' => $attributeValue['attribute_id'],
'entity_type' => $entityType
]
);
}
}
Expand All @@ -184,8 +194,9 @@ public function execute($entityType, $entityData, $arguments = [])
*
* @param Select[] $selects
* @param array $identifiers
* @return void
*/
private function applyIdentifierForSelects(array $selects, array $identifiers)
private function applyIdentifierForSelects(array $selects, array $identifiers): void
{
foreach ($selects as $select) {
foreach ($identifiers as $identifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
<?php else : ?>
<?php $_option = $block->getFormattedOption($_option['value']); ?>
<?php $dots = 'dots' . uniqid(); ?>
<?= $block->escapeHtml($_option['value'], ['a']) ?><?php if (isset($_option['remainder']) && $_option['remainder']) : ?> <span id="<?= /* @noEscape */ $dots; ?>"> ...</span>
<?php $id = 'id' . uniqid(); ?>
<span id="<?= /* @noEscape */ $id; ?>"><?= $block->escapeHtml($_option['remainder'], ['a']) ?></span>
<?php $id = 'id' . uniqid(); ?>
<?= $block->escapeHtml($_option['value'], ['a']) ?><?php if (isset($_option['remainder']) && $_option['remainder']) : ?><span id="<?= /* @noEscape */ $dots; ?>"> ...</span><span id="<?= /* @noEscape */ $id; ?>"><?= $block->escapeHtml($_option['remainder'], ['a']) ?></span>
<script>
require(['prototype'], function() {
$('<?= /* @noEscape */ $id; ?>').hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

//

.modals-overlay {
&:extend(.abs-modal-overlay all);
}

.modal-popup,
.modal-slide {
.action-close {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@
}

.block-content {
&:extend(.abs-add-clearfix-desktop all);

.box {
&:extend(.abs-blocks-2columns all);
}

.actions-toolbar {
clear: both;
.lib-actions-toolbar(
Expand Down Expand Up @@ -167,4 +161,16 @@
&:extend(.abs-add-clearfix-desktop all);
}
}

.column {
.block-addbysku {
.block-content {
&:extend(.abs-add-clearfix-desktop all);

.box {
&:extend(.abs-blocks-2columns all);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

.opc-estimated-wrapper {
&:extend(.abs-add-clearfix all);
&:extend(.abs-no-display-desktop all);
.lib-css(border-bottom, @border-width__base solid @color-gray80);
margin: 0 0 15px;
padding: 18px 15px;
Expand All @@ -37,7 +36,7 @@
&:before {
.lib-css(color, @button__color);
}

&:hover:before {
.lib-css(color, @button__hover__color);
}
Expand All @@ -53,6 +52,6 @@

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
.opc-estimated-wrapper {
display: none;
&:extend(.abs-no-display-desktop all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
& when (@media-common = true) {
.gift-message {
.field {
&:extend(.abs-clearfix all);
margin-bottom: @indent__base;

.label {
Expand Down
49 changes: 47 additions & 2 deletions app/design/frontend/Magento/blank/web/css/source/_extends.less
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
& when (@media-common = true) {
.abs-block-title {
margin-bottom: 15px;

> strong {
.lib-heading(h3);
}
Expand All @@ -194,7 +194,7 @@
.abs-account-blocks {
.block-title {
&:extend(.abs-block-title all);

> .action {
margin-left: 15px;
}
Expand Down Expand Up @@ -849,6 +849,51 @@
}
}

//
// Account pages: title
// ---------------------------------------------

& when (@media-common = true) {
.abs-account-title {
> strong,
> span {
.lib-font-size(22);
.lib-css(font-weight, @font-weight__light);
}

.lib-css(border-bottom, 1px solid @border-color__base);
.lib-css(margin-bottom, @indent__m);
.lib-css(padding-bottom, @indent__s);
}
}

//
// Ratings: vertical alignment
// ---------------------------------------------

& when (@media-common = true) {
.abs-rating-summary {
.rating {
&-summary {
display: table-row;
}

&-label {
display: table-cell;
padding-bottom: @indent__xs;
padding-right: @indent__m;
padding-top: 1px;
vertical-align: top;
}

&-result {
display: table-cell;
vertical-align: top;
}
}
}
}

//
// Add colon
// ---------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@
}

//
// Forms: margin-bottom for small forms
// Ratings: vertical alignment
// ---------------------------------------------

& when (@media-common = true) {
Expand Down
1 change: 0 additions & 1 deletion lib/web/css/source/components/_modals.less
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@

// Modals overlay
.modals-overlay {
&:extend(.abs-modal-overlay all);
.lib-css(z-index, @overlay__z-index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ define([
* @returns {String}
*/
decodeVariables: function (content) {
var doc = (new DOMParser()).parseFromString(content.replace(/&quot;/g, '&amp;quot;'), 'text/html');
var doc = (new DOMParser()).parseFromString(content.replace(/&quot;/g, '&amp;quot;'), 'text/html'),
returnval = '';

[].forEach.call(doc.querySelectorAll('span.magento-variable'), function (el) {
var $el = jQuery(el);
Expand All @@ -195,7 +196,12 @@ define([
}
});

return doc.body ? doc.body.innerHTML.replace(/&amp;quot;/g, '&quot;') : content;
returnval += doc.head.innerHTML ?
doc.head.innerHTML.replace(/&amp;quot;/g, '&quot;') : '';
returnval += doc.body.innerHTML ?
doc.body.innerHTML.replace(/&amp;quot;/g, '&quot;') : '';

return returnval ? returnval : content;
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ define([
* @return {String}
*/
removeDuplicateAncestorWidgetSpanElement: function (content) {
var parser, doc;
var parser, doc, returnval = '';

if (!window.DOMParser) {
return content;
Expand All @@ -212,7 +212,12 @@ define([
widgetEl.parentNode.removeChild(widgetEl);
});

return doc.body ? doc.body.innerHTML.replace(/&amp;quot;/g, '&quot;') : content;
returnval += doc.head.innerHTML ?
doc.head.innerHTML.replace(/&amp;quot;/g, '&quot;') : '';
returnval += doc.body.innerHTML ?
doc.body.innerHTML.replace(/&amp;quot;/g, '&quot;') : '';

return returnval ? returnval : content;
},

/**
Expand Down
1 change: 1 addition & 0 deletions lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ define([
'convert_urls': false,
'content_css': this.config.tinymce4['content_css'],
'relative_urls': true,
'valid_children': '+body[style]',
menubar: false,
plugins: this.config.tinymce4.plugins,
toolbar: this.config.tinymce4.toolbar,
Expand Down

0 comments on commit 5c5978a

Please sign in to comment.