Skip to content

Commit

Permalink
Merge branch '2.4-develop' into save-checkout-address
Browse files Browse the repository at this point in the history
  • Loading branch information
Usik2203 committed Oct 24, 2020
2 parents a54cc96 + 3bcbd95 commit 657420d
Show file tree
Hide file tree
Showing 268 changed files with 6,472 additions and 862 deletions.
4 changes: 2 additions & 2 deletions .github/stale.yml
@@ -1,7 +1,7 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 76
daysUntilStale: 76

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
Expand All @@ -18,7 +18,7 @@ exemptLabels:
- "Progress: dev in progress"
- "Progress: PR in progress"
- "Progress: done"
- "B2B: GraphQL"
- "B2B: GraphQL"
- "Progress: PR Created"
- "PAP"
- "Project: Login as Customer"
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/AdminNotification/Block/ToolbarEntry.php
Expand Up @@ -10,7 +10,6 @@
* Toolbar entry that shows latest notifications
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @since 100.0.2
*/
class ToolbarEntry extends \Magento\Backend\Block\Template
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/AdminNotification/Model/Feed.php
Expand Up @@ -12,7 +12,6 @@
/**
* AdminNotification Feed model
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @api
* @since 100.0.2
Expand Down
Expand Up @@ -8,7 +8,6 @@
/**
* AdminNotification Inbox interface
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
Expand Down
Expand Up @@ -8,7 +8,6 @@
/**
* Notification service model
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
Expand Down
Expand Up @@ -6,8 +6,6 @@

/**
* AdminNotification Inbox model
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\AdminNotification\Model\ResourceModel\Grid;

Expand Down
Expand Up @@ -9,8 +9,6 @@
* AdminNotification Inbox model
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
Expand Down
Expand Up @@ -6,8 +6,6 @@

/**
* Collection of unread notifications
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;

Expand Down
Expand Up @@ -9,8 +9,7 @@

/**
* AdminNotification observer
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class PredispatchAdminActionControllerObserver implements ObserverInterface
{
Expand Down
Expand Up @@ -9,7 +9,6 @@
* Search queries relations grid container
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @since 100.0.2
*/
class Edit extends \Magento\Backend\Block\Widget\Grid\Container
Expand Down
Expand Up @@ -9,7 +9,6 @@
* Search query relations edit grid
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @since 100.0.2
*/
class Grid extends \Magento\Backend\Block\Widget\Grid
Expand Down
Expand Up @@ -8,7 +8,6 @@
/**
* Catalog search recommendations resource model
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.php
Expand Up @@ -117,7 +117,7 @@ protected function _countExpr($expr, $collection)
foreach ($parsedExpression as $operand) {
if ($this->_parser->isOperation($operand)) {
$this->_checkOperandsSet($firstOperand, $secondOperand, $tmpResult, $result);
$result = $this->_operate($firstOperand, $secondOperand, $operand, $tmpResult, $result);
$result = $this->_operate($firstOperand, $secondOperand, $operand);
$firstOperand = $secondOperand = null;
} else {
if (null === $firstOperand) {
Expand All @@ -133,9 +133,9 @@ protected function _countExpr($expr, $collection)
/**
* Check if operands in not null and set operands values if they are empty
*
* @param float|int &$firstOperand
* @param float|int &$secondOperand
* @param float|int &$tmpResult
* @param float|int $firstOperand
* @param float|int $secondOperand
* @param float|int $tmpResult
* @param float|int $result
* @return void
*/
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Backend/Test/Unit/Helper/DataTest.php
Expand Up @@ -42,7 +42,6 @@ protected function setUp(): void
$this->createMock(Auth::class),
$this->_frontResolverMock,
$this->createMock(Random::class),
$this->getMockForAbstractClass(RequestInterface::class)
);
}

Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Catalog/Block/Product/View/Details.php
Expand Up @@ -27,10 +27,11 @@ class Details extends \Magento\Framework\View\Element\Template
*
* @return array
* @since 103.0.1
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getGroupSortedChildNames(string $groupName, string $callback): array
{
$groupChildNames = $this->getGroupChildNames($groupName, $callback);
$groupChildNames = $this->getGroupChildNames($groupName);
$layout = $this->getLayout();

$childNamesSortOrder = [];
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Helper/Product/View.php
Expand Up @@ -193,7 +193,7 @@ public function initProductLayout(ResultPage $resultPage, $product, $params = nu
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
}
}

$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], null, false);
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]);

Expand Down
@@ -0,0 +1,96 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Catalog\Model\Attribute\Backend;

use Magento\Catalog\Model\AbstractModel;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
use Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend as ParentBackend;
use Magento\Eav\Model\Entity\Attribute\Exception;
use Magento\Framework\DataObject;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Validation\ValidationException;
use Magento\Framework\Validator\HTML\WYSIWYGValidatorInterface;

/**
* Default backend model for catalog attributes.
*/
class DefaultBackend extends ParentBackend
{
/**
* @var WYSIWYGValidatorInterface
*/
private $wysiwygValidator;

/**
* @param WYSIWYGValidatorInterface $wysiwygValidator
*/
public function __construct(WYSIWYGValidatorInterface $wysiwygValidator)
{
$this->wysiwygValidator = $wysiwygValidator;
}

/**
* Validate user HTML value.
*
* @param DataObject $object
* @return void
* @throws LocalizedException
*/
private function validateHtml(DataObject $object): void
{
$attribute = $this->getAttribute();
$code = $attribute->getAttributeCode();
if ($attribute instanceof Attribute && $attribute->getIsHtmlAllowedOnFront()) {
$value = $object->getData($code);
if ($value
&& is_string($value)
&& (!($object instanceof AbstractModel) || $object->getData($code) !== $object->getOrigData($code))
) {
try {
$this->wysiwygValidator->validate($object->getData($code));
} catch (ValidationException $exception) {
$attributeException = new Exception(
__(
'Using restricted HTML elements for "%1". %2',
$attribute->getName(),
$exception->getMessage()
),
$exception
);
$attributeException->setAttributeCode($code)->setPart('backend');
throw $attributeException;
}
}
}
}

/**
* @inheritDoc
*/
public function beforeSave($object)
{
parent::beforeSave($object);
$this->validateHtml($object);

return $this;
}

/**
* @inheritDoc
*/
public function validate($object)
{
$isValid = parent::validate($object);
if ($isValid) {
$this->validateHtml($object);
}

return $isValid;
}
}

0 comments on commit 657420d

Please sign in to comment.