diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 999f08aa1ea6e..29fb0d282a87c 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -72,6 +72,11 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements const CACHE_TAG = 'cat_c'; + /** + * Category Store Id + */ + const STORE_ID = 'store_id'; + /**#@-*/ protected $_eventPrefix = 'catalog_category'; @@ -564,12 +569,12 @@ public function getStoreIds() * * If store id is underfined for category return current active store id * - * @return integer + * @return int */ public function getStoreId() { - if ($this->hasData('store_id')) { - return (int)$this->_getData('store_id'); + if ($this->hasData(self::STORE_ID)) { + return (int)$this->_getData(self::STORE_ID); } return (int)$this->_storeManager->getStore()->getId(); } @@ -585,7 +590,7 @@ public function setStoreId($storeId) if (!is_numeric($storeId)) { $storeId = $this->_storeManager->getStore($storeId)->getId(); } - $this->setData('store_id', $storeId); + $this->setData(self::STORE_ID, $storeId); $this->getResource()->setStoreId($storeId); return $this; } diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index b29eee9a47f8b..753fb0b5e18d7 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -498,8 +498,9 @@ protected function _getResource() } /** - * Get a list of custom attribute codes that belongs to product attribute set. If attribute set not specified for - * product will return all product attribute codes + * Get a list of custom attribute codes that belongs to product attribute set. + * + * If attribute set not specified for product will return all product attribute codes * * @return string[] */ @@ -526,9 +527,9 @@ protected function getCustomAttributesCodes() public function getStoreId() { if ($this->hasData(self::STORE_ID)) { - return $this->getData(self::STORE_ID); + return (int)$this->getData(self::STORE_ID); } - return $this->_storeManager->getStore()->getId(); + return (int)$this->_storeManager->getStore()->getId(); } /** @@ -584,8 +585,9 @@ public function getPrice() } /** - * @codeCoverageIgnoreStart * Get visibility status + * + * @codeCoverageIgnoreStart * @see \Magento\Catalog\Model\Product\Visibility * * @return int @@ -662,6 +664,7 @@ public function getStatus() /** * Retrieve type instance of the product. + * * Type instance implements product type depended logic and is a singleton shared by all products of the same type. * * @return \Magento\Catalog\Model\Product\Type\AbstractType @@ -822,9 +825,10 @@ public function getStoreIds() /** * Retrieve product attributes - * if $groupId is null - retrieve all product attributes * - * @param int $groupId Retrieve attributes of the specified group + * If $groupId is null - retrieve all product attributes + * + * @param int $groupId Retrieve attributes of the specified group * @param bool $skipSuper Not used * @return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute[] * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -916,6 +920,7 @@ public function beforeSave() /** * Check/set if options can be affected when saving product + * * If value specified, it will be set. * * @param bool $value @@ -976,7 +981,7 @@ public function setQty($qty) */ public function getQty() { - return $this->getData('qty'); + return (float)$this->getData('qty'); } /** @@ -1036,6 +1041,7 @@ public function reindex() /** * Clear cache related with product and protect delete from not admin + * * Register indexing event before delete product * * @return \Magento\Catalog\Model\Product @@ -1545,11 +1551,11 @@ public function hasGalleryAttribute() /** * Add image to media gallery * - * @param string $file file path of image in file system - * @param string|array $mediaAttribute code of attribute with type 'media_image', - * leave blank if image should be only in gallery - * @param boolean $move if true, it will move source file - * @param boolean $exclude mark image as disabled in product page view + * @param string $file file path of image in file system + * @param string|array $mediaAttribute code of attribute with type 'media_image', + * leave blank if image should be only in gallery + * @param bool $move if true, it will move source file + * @param bool $exclude mark image as disabled in product page view * @return \Magento\Catalog\Model\Product */ public function addImageToMediaGallery($file, $mediaAttribute = null, $move = false, $exclude = true) @@ -1711,6 +1717,7 @@ public function getIsSalable() /** * Check is a virtual product + * * Data helper wrapper * * @return bool @@ -1803,9 +1810,9 @@ public function formatUrlKey($str) /** * Save current attribute with code $code and assign new value * - * @param string $code Attribute code - * @param mixed $value New attribute value - * @param int $store Store ID + * @param string $code Attribute code + * @param mixed $value New attribute value + * @param int $store Store ID * @return void */ public function addAttributeUpdate($code, $value, $store) @@ -1875,6 +1882,7 @@ public function getRequestPath() /** * Custom function for other modules + * * @return string */ public function getGiftMessageAvailable() @@ -1993,6 +2001,8 @@ public function getOptions() } /** + * Set product options + * * @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface[] $options * @return $this */ @@ -2016,10 +2026,10 @@ public function getIsVirtual() /** * Add custom option information to product * - * @param string $code Option code - * @param mixed $value Value of the option - * @param int|Product $product Product ID - * @return $this + * @param string $code Option code + * @param mixed $value Value of the option + * @param int|Product $product Product ID + * @return $this */ public function addCustomOption($code, $value, $product = null) { @@ -2213,6 +2223,7 @@ public function getPreconfiguredValues() /** * Prepare product custom options. + * * To be sure that all product custom options does not has ID and has product instance * * @return \Magento\Catalog\Model\Product @@ -2547,7 +2558,7 @@ public function setTypeId($typeId) } /** - * {@inheritdoc} + * @inheritdoc * * @return \Magento\Catalog\Api\Data\ProductExtensionInterface */ @@ -2557,7 +2568,7 @@ public function getExtensionAttributes() } /** - * {@inheritdoc} + * @inheritdoc * * @param \Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes * @return $this @@ -2570,6 +2581,8 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio //@codeCoverageIgnoreEnd /** + * Convert array to media gallery interface + * * @param array $mediaGallery * @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[] */ @@ -2587,6 +2600,8 @@ protected function convertToMediaGalleryInterface(array $mediaGallery) } /** + * Returns media gallery entries + * * @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]|null */ public function getMediaGalleryEntries() @@ -2601,6 +2616,8 @@ public function getMediaGalleryEntries() } /** + * Set media gallery entries + * * @param ProductAttributeMediaGalleryEntryInterface[] $mediaGalleryEntries * @return $this */ @@ -2643,6 +2660,8 @@ public function setId($value) } /** + * Returns link repository instance + * * @return ProductLinkRepositoryInterface */ private function getLinkRepository() @@ -2655,6 +2674,8 @@ private function getLinkRepository() } /** + * Returns media gallery processor instance + * * @return Product\Gallery\Processor */ private function getMediaGalleryProcessor() diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/error-processor.js b/app/code/Magento/Checkout/view/frontend/web/js/model/error-processor.js index 848a7daf71e1b..16fc459729bbc 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/error-processor.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/error-processor.js @@ -8,8 +8,9 @@ */ define([ 'mage/url', - 'Magento_Ui/js/model/messageList' -], function (url, globalMessageList) { + 'Magento_Ui/js/model/messageList', + 'consoleLogger' +], function (url, globalMessageList, consoleLogger) { 'use strict'; return { @@ -25,8 +26,12 @@ define([ if (response.status == 401) { //eslint-disable-line eqeqeq window.location.replace(url.build('customer/account/login/')); } else { - error = JSON.parse(response.responseText); - messageContainer.addErrorMessage(error); + try { + error = JSON.parse(response.responseText); + messageContainer.addErrorMessage(error); + } catch (e) { + consoleLogger.error(e); + } } } }; diff --git a/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php b/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php index 582f87508089f..aeb57010e4969 100644 --- a/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php +++ b/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php @@ -97,7 +97,7 @@ public function process($scope, $scopeCode, $value, $path) $field = $configStructure->getElementByConfigPath($path); /** @var Value $backendModel */ - $backendModel = $field && $field->hasBackendModel() + $backendModel = $field instanceof Field && $field->hasBackendModel() ? $field->getBackendModel() : $this->configValueFactory->create(); diff --git a/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php b/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php new file mode 100644 index 0000000000000..703926b4c0116 --- /dev/null +++ b/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php @@ -0,0 +1,89 @@ +groupsConfigMock = $this->getMockBuilder( + GroupsConfigModel::class + )->disableOriginalConstructor()->getMock(); + $this->converterMock = $this->getMockBuilder(Converter::class)->getMock(); + $this->converterPlugin = new ConverterPlugin($this->groupsConfigMock); + } + + /** + * Tests afterConvert method with no $result['data']['default']['system'] set + */ + public function testAfterConvertWithNoData() + { + $expectedResult = ['test']; + $this->groupsConfigMock->expects($this->never()) + ->method('get'); + + $result = $this->converterPlugin->afterConvert($this->converterMock, $expectedResult); + + self::assertSame($expectedResult, $result); + } + + /** + * Tests afterConvert method with $result['data']['default']['system'] set + */ + public function testAfterConvertWithData() + { + $groups = [ + 'group1' => ['val1' => ['value' => '1']], + 'group2' => ['val2' => ['value' => '2']] + ]; + $expectedResult['data']['default']['system']['cron'] = [ + 'group1' => [ + 'val1' => '1' + ], + 'group2' => [ + 'val2' => '2' + ] + ]; + $result['data']['default']['system']['cron'] = '1'; + + $this->groupsConfigMock->expects($this->once()) + ->method('get') + ->willReturn($groups); + + $result = $this->converterPlugin->afterConvert($this->converterMock, $result); + + self::assertEquals($expectedResult, $result); + } +} diff --git a/app/code/Magento/Cron/etc/di.xml b/app/code/Magento/Cron/etc/di.xml index a37f3760b70a5..3e3bdc2053576 100644 --- a/app/code/Magento/Cron/etc/di.xml +++ b/app/code/Magento/Cron/etc/di.xml @@ -16,6 +16,18 @@ + + + /var/log/cron.log + + + + + + Magento\Cron\Model\VirtualLoggerHandler + + + @@ -25,6 +37,7 @@ shellBackground + Magento\Cron\Model\VirtualLogger diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/InlineEdit.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/InlineEdit.php index 98db7be559cdf..3c3808d0a1ee6 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/InlineEdit.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/InlineEdit.php @@ -6,14 +6,16 @@ namespace Magento\Customer\Controller\Adminhtml\Index; use Magento\Backend\App\Action; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\EmailNotificationInterface; -use Magento\Customer\Test\Block\Form\Login; use Magento\Customer\Ui\Component\Listing\AttributeRepository; -use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Message\MessageInterface; /** + * Customer inline edit action + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class InlineEdit extends \Magento\Backend\App\Action implements HttpPostActionInterface @@ -102,7 +104,11 @@ private function getEmailNotification() } /** + * Inline edit action execute + * * @return \Magento\Framework\Controller\Result\Json + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function execute() { @@ -250,7 +256,7 @@ protected function processAddressData(array $data) protected function getErrorMessages() { $messages = []; - foreach ($this->getMessageManager()->getMessages()->getItems() as $error) { + foreach ($this->getMessageManager()->getMessages()->getErrors() as $error) { $messages[] = $error->getText(); } return $messages; @@ -263,7 +269,7 @@ protected function getErrorMessages() */ protected function isErrorExists() { - return (bool)$this->getMessageManager()->getMessages(true)->getCount(); + return (bool)$this->getMessageManager()->getMessages(true)->getCountByType(MessageInterface::TYPE_ERROR); } /** diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php index 913c41070856e..78d9dd7003522 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php @@ -6,6 +6,7 @@ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; use Magento\Customer\Model\EmailNotificationInterface; +use Magento\Framework\Message\MessageInterface; /** * @SuppressWarnings(PHPMD.TooManyFields) @@ -242,10 +243,11 @@ protected function prepareMocksForErrorMessagesProcessing() ->method('getMessages') ->willReturn($this->messageCollection); $this->messageCollection->expects($this->once()) - ->method('getItems') + ->method('getErrors') ->willReturn([$this->message]); $this->messageCollection->expects($this->once()) - ->method('getCount') + ->method('getCountByType') + ->with(MessageInterface::TYPE_ERROR) ->willReturn(1); $this->message->expects($this->once()) ->method('getText') diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php index 6601c05051378..29ead9ff810e5 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php @@ -216,6 +216,7 @@ public function __construct( /** * Get Serializer instance. + * * @deprecated 100.2.0 * * @return Json @@ -244,8 +245,8 @@ protected function _construct() /** * Load attribute data by code * - * @param string|int|\Magento\Eav\Model\Entity\Type $entityType - * @param string $code + * @param string|int|\Magento\Eav\Model\Entity\Type $entityType + * @param string $code * @return $this * @throws LocalizedException */ @@ -296,7 +297,7 @@ public function setAttributeId($data) } /** - * {@inheritdoc} + * @inheritdoc * @codeCoverageIgnore */ public function getAttributeId() @@ -305,6 +306,8 @@ public function getAttributeId() } /** + * Set attribute code + * * @param string $data * @return $this * @codeCoverageIgnore @@ -315,7 +318,7 @@ public function setAttributeCode($data) } /** - * {@inheritdoc} + * @inheritdoc * @codeCoverageIgnore */ public function getAttributeCode() @@ -324,6 +327,8 @@ public function getAttributeCode() } /** + * Set attribute model + * * @param array $data * @return $this * @codeCoverageIgnore @@ -334,6 +339,8 @@ public function setAttributeModel($data) } /** + * Returns attribute model + * * @return array * @codeCoverageIgnore */ @@ -343,6 +350,8 @@ public function getAttributeModel() } /** + * Set backend type + * * @param string $data * @return $this * @codeCoverageIgnore @@ -353,7 +362,7 @@ public function setBackendType($data) } /** - * {@inheritdoc} + * @inheritdoc * @codeCoverageIgnore */ public function getBackendType() @@ -362,6 +371,8 @@ public function getBackendType() } /** + * Set backend model + * * @param string $data * @return $this * @codeCoverageIgnore @@ -372,7 +383,7 @@ public function setBackendModel($data) } /** - * {@inheritdoc} + * @inheritdoc * @codeCoverageIgnore */ public function getBackendModel() @@ -381,6 +392,8 @@ public function getBackendModel() } /** + * Set backend table + * * @param string $data * @return $this * @codeCoverageIgnore @@ -391,6 +404,8 @@ public function setBackendTable($data) } /** + * Returns is visible on front + * * @return bool * @SuppressWarnings(PHPMD.BooleanGetMethodName) * @codeCoverageIgnore @@ -401,6 +416,8 @@ public function getIsVisibleOnFront() } /** + * Returns default value + * * @return string|int|bool|float * @codeCoverageIgnore */ @@ -422,6 +439,8 @@ public function setDefaultValue($defaultValue) } /** + * Returns attribute set id + * * @return int * @codeCoverageIgnore */ @@ -431,6 +450,8 @@ public function getAttributeSetId() } /** + * Set attribute set id + * * @param int $id * @return $this * @codeCoverageIgnore @@ -443,7 +464,7 @@ public function setAttributeSetId($id) } /** - * {@inheritdoc} + * @inheritdoc * @codeCoverageIgnore */ public function getEntityTypeId() @@ -452,6 +473,8 @@ public function getEntityTypeId() } /** + * Set entity type id + * * @param int|string $id * @return $this * @codeCoverageIgnore @@ -464,6 +487,8 @@ public function setEntityTypeId($id) } /** + * Set entity type + * * @param string $type * @return $this * @codeCoverageIgnore @@ -495,7 +520,7 @@ public function getAlias($entity = null) /** * Set attribute name * - * @param string $name + * @param string $name * @return $this * @codeCoverageIgnore */ @@ -608,9 +633,11 @@ public function getSource() { if (empty($this->_source)) { if (!$this->getSourceModel()) { - $this->setSourceModel($this->_getDefaultSourceModel()); + $this->_source = $this->_getDefaultSourceModel(); + } else { + $this->_source = $this->getSourceModel(); } - $source = $this->_universalFactory->create($this->getSourceModel()); + $source = $this->_universalFactory->create($this->_source); if (!$source) { throw new LocalizedException( __( @@ -639,6 +666,8 @@ public function usesSource() } /** + * Returns default backend model + * * @return string * @codeCoverageIgnore */ @@ -648,6 +677,8 @@ protected function _getDefaultBackendModel() } /** + * Returns default frontend model + * * @return string * @codeCoverageIgnore */ @@ -657,6 +688,8 @@ protected function _getDefaultFrontendModel() } /** + * Returns default source model + * * @return string * @codeCoverageIgnore */ @@ -891,6 +924,7 @@ public function _getFlatColumnsDdlDefinition() /** * Retrieve flat columns definition in old format (before MMDB support) + * * Used in database compatible mode * * @deprecated 100.2.0 @@ -1066,8 +1100,8 @@ public function getFlatUpdateSelect($store = null) } /** + * @inheritdoc * @codeCoverageIgnoreStart - * {@inheritdoc} */ public function getIsUnique() { @@ -1086,7 +1120,7 @@ public function setIsUnique($isUnique) } /** - * {@inheritdoc} + * @inheritdoc */ public function getFrontendClass() { @@ -1105,7 +1139,7 @@ public function setFrontendClass($frontendClass) } /** - * {@inheritdoc} + * @inheritdoc */ public function getFrontendInput() { @@ -1113,7 +1147,7 @@ public function getFrontendInput() } /** - * {@inheritdoc} + * @inheritdoc */ public function setFrontendInput($frontendInput) { @@ -1121,7 +1155,7 @@ public function setFrontendInput($frontendInput) } /** - * {@inheritdoc} + * @inheritdoc */ public function getIsRequired() { @@ -1129,7 +1163,7 @@ public function getIsRequired() } /** - * {@inheritdoc} + * @inheritdoc */ public function setIsRequired($isRequired) { @@ -1139,7 +1173,7 @@ public function setIsRequired($isRequired) //@codeCoverageIgnoreEnd /** - * {@inheritdoc} + * @inheritdoc */ public function getOptions() { @@ -1200,8 +1234,8 @@ protected function convertToObjects(array $options) } /** + * @inheritdoc * @codeCoverageIgnoreStart - * {@inheritdoc} */ public function getIsUserDefined() { @@ -1220,7 +1254,7 @@ public function setIsUserDefined($isUserDefined) } /** - * {@inheritdoc} + * @inheritdoc */ public function getDefaultFrontendLabel() { @@ -1239,7 +1273,7 @@ public function setDefaultFrontendLabel($defaultFrontendLabel) } /** - * {@inheritdoc} + * @inheritdoc */ public function getFrontendLabels() { @@ -1271,7 +1305,7 @@ public function setFrontendLabels(array $frontendLabels = null) } /** - * {@inheritdoc} + * @inheritdoc */ public function getNote() { @@ -1290,7 +1324,7 @@ public function setNote($note) } /** - * {@inheritdoc} + * @inheritdoc */ public function getSourceModel() { @@ -1311,7 +1345,7 @@ public function setSourceModel($sourceModel) //@codeCoverageIgnoreEnd /** - * {@inheritdoc} + * @inheritdoc */ public function getValidationRules() { @@ -1338,7 +1372,7 @@ public function setValidationRules(array $validationRules = null) } /** - * {@inheritdoc} + * @inheritdoc * * @return \Magento\Eav\Api\Data\AttributeExtensionInterface|null * @codeCoverageIgnore @@ -1355,7 +1389,7 @@ public function getExtensionAttributes() } /** - * {@inheritdoc} + * @inheritdoc * * @param \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes * @return $this diff --git a/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml b/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml index 892a22129adfd..c3f34c5abc1df 100644 --- a/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml +++ b/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml @@ -7,8 +7,8 @@ --> - + - + diff --git a/app/code/Magento/Integration/Model/Config/Consolidated/Converter.php b/app/code/Magento/Integration/Model/Config/Consolidated/Converter.php index 674a97a68d065..c10759d602748 100644 --- a/app/code/Magento/Integration/Model/Config/Consolidated/Converter.php +++ b/app/code/Magento/Integration/Model/Config/Consolidated/Converter.php @@ -36,7 +36,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function convert($source) { @@ -80,9 +80,16 @@ public function convert($source) $result[$integrationName][self::API_RESOURCES][] = $name; } } + + // Add root resource if any child has been added + if (!empty($result[$integrationName][self::API_RESOURCES])) { + array_unshift($result[$integrationName][self::API_RESOURCES], $allResources[1]['id']); + } + // Remove any duplicates added parents - $result[$integrationName][self::API_RESOURCES] = - array_values(array_unique($result[$integrationName][self::API_RESOURCES])); + $result[$integrationName][self::API_RESOURCES] = array_values( + array_unique($result[$integrationName][self::API_RESOURCES]) + ); } return $result; } diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/acl.php b/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/acl.php index 5b7bbace5a65d..42b62acaba5b4 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/acl.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/acl.php @@ -6,6 +6,8 @@ return [ [], [ + 'id' => 'Magento_Backend::admin', + 'title' => 'Magento Admin (Root)', 'children' => [ [ diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.php b/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.php index 54e05d5ef9017..0293492c77658 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.php @@ -9,6 +9,7 @@ 'endpoint_url' => 'http://endpoint.com', 'identity_link_url' => 'http://www.example.com/identity', 'resource' => [ + 'Magento_Backend::admin', 'Magento_Customer::manageParent', 'Magento_Customer::manage', 'Magento_SalesRule::quoteParent', @@ -17,6 +18,9 @@ ], 'TestIntegration2' => [ 'email' => 'test-integration2@magento.com', - 'resource' => ['Magento_Sales::sales'] + 'resource' => [ + 'Magento_Backend::admin', + 'Magento_Sales::sales' + ] ] ]; diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.xml b/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.xml index 585fabc24299d..f8bcf3fc4a2ce 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.xml +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/Consolidated/_files/integration.xml @@ -18,6 +18,7 @@ test-integration2@magento.com + diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender.php b/app/code/Magento/Sales/Model/Order/Email/Sender.php index 6d4480c4c45e0..564fd1e2a4b98 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender.php @@ -65,6 +65,8 @@ public function __construct( } /** + * Send order email if it is enabled in configuration. + * * @param Order $order * @return bool */ @@ -81,17 +83,21 @@ protected function checkAndSend(Order $order) try { $sender->send(); - $sender->sendCopyTo(); } catch (\Exception $e) { $this->logger->error($e->getMessage()); - return false; } - + try { + $sender->sendCopyTo(); + } catch (\Exception $e) { + $this->logger->error($e->getMessage()); + } return true; } /** + * Populate order email template with customer information. + * * @param Order $order * @return void */ @@ -113,6 +119,8 @@ protected function prepareTemplate(Order $order) } /** + * Create Sender object using appropriate template and identity. + * * @return Sender */ protected function getSender() @@ -126,6 +134,8 @@ protected function getSender() } /** + * Get template options. + * * @return array */ protected function getTemplateOptions() @@ -137,6 +147,8 @@ protected function getTemplateOptions() } /** + * Render shipping address into html. + * * @param Order $order * @return string|null */ @@ -148,6 +160,8 @@ protected function getFormattedShippingAddress($order) } /** + * Render billing address into html. + * * @param Order $order * @return string|null */ diff --git a/app/code/Magento/Sales/Model/ResourceModel/Order/Shipment/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Order/Shipment/Collection.php index f004a1ee37e65..8758fc1da92d8 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Order/Shipment/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Order/Shipment/Collection.php @@ -57,14 +57,16 @@ protected function _construct() } /** - * Used to emulate after load functionality for each item without loading them + * Unserialize packages in each item * * @return $this */ protected function _afterLoad() { - $this->walk('afterLoad'); + foreach ($this->_items as $item) { + $this->getResource()->unserializeFields($item); + } - return $this; + return parent::_afterLoad(); } } diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml index 50ffe979651ea..f8d2e373e8af8 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml @@ -12,12 +12,12 @@ - + - + diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js index 86d430041d7a8..15bcf2e73393e 100644 --- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js @@ -306,12 +306,13 @@ define([ dropdown.append(html); }); + this._resetResponseList(true); + this.responseList.indexList = this.autoComplete.html(dropdown) .css(clonePosition) .show() .find(this.options.responseFieldElements + ':visible'); - this._resetResponseList(false); this.element.removeAttr('aria-activedescendant'); if (this.responseList.indexList.length) { @@ -338,6 +339,11 @@ define([ this._resetResponseList(false); } }.bind(this)); + } else { + this._resetResponseList(true); + this.autoComplete.hide(); + this._updateAriaHasPopup(false); + this.element.removeAttr('aria-activedescendant'); } }, this)); } else { diff --git a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php b/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php index 870705db941cc..168ab67f8cf50 100644 --- a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php +++ b/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php @@ -5,8 +5,8 @@ */ namespace Magento\Signifyd\Model\CaseServices; +use Magento\Framework\Api\SimpleDataObjectConverter; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NotFoundException; use Magento\Signifyd\Api\CaseRepositoryInterface; use Magento\Signifyd\Api\Data\CaseInterface; use Magento\Signifyd\Model\CommentsHistoryUpdater; @@ -73,7 +73,6 @@ public function __construct( * @param CaseInterface $case * @param array $data * @return void - * @throws NotFoundException * @throws LocalizedException */ public function update(CaseInterface $case, array $data) @@ -111,7 +110,7 @@ private function setCaseData(CaseInterface $case, array $data) 'orderId' ]; foreach ($data as $key => $value) { - $methodName = 'set' . ucfirst($key); + $methodName = 'set' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($key); if (!in_array($key, $notResolvedKeys) && method_exists($case, $methodName)) { call_user_func([$case, $methodName], $value); } diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php index ffc2bf5f6d1cf..b4e54104bdfb4 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php @@ -3,17 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - -/** - * Sitemap grid link column renderer - * - */ namespace Magento\Sitemap\Block\Adminhtml\Grid\Renderer; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot; use Magento\Framework\App\ObjectManager; +/** + * Sitemap grid link column renderer + */ class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { /** @@ -62,6 +60,7 @@ public function render(\Magento\Framework\DataObject $row) { /** @var $sitemap \Magento\Sitemap\Model\Sitemap */ $sitemap = $this->_sitemapFactory->create(); + $sitemap->setStoreId($row->getStoreId()); $url = $this->escapeHtml($sitemap->getSitemapUrl($row->getSitemapPath(), $row->getSitemapFilename())); $fileName = preg_replace('/^\//', '', $row->getSitemapPath() . $row->getSitemapFilename()); diff --git a/app/code/Magento/Webapi/Controller/Rest/ParamsOverrider.php b/app/code/Magento/Webapi/Controller/Rest/ParamsOverrider.php index 1d8ccc127cea9..d1a3c0c0f0864 100644 --- a/app/code/Magento/Webapi/Controller/Rest/ParamsOverrider.php +++ b/app/code/Magento/Webapi/Controller/Rest/ParamsOverrider.php @@ -197,7 +197,7 @@ private function isPropertyDeclaredInDataObject( $index = array_search($serviceMethodParamName, array_column($methodParams, 'name')); if ($index !== false) { $paramObjectType = $methodParams[$index][MethodsMap::METHOD_META_TYPE]; - $setter = 'set' . ucfirst(SimpleDataObjectConverter::snakeCaseToCamelCase($objectProperty)); + $setter = 'set' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($objectProperty); if (array_key_exists( $setter, $this->getMethodsMap()->getMethodsMap($paramObjectType) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 4fec36633c9b6..1bfc928f2916a 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -498,6 +498,7 @@ public function install($cleanup) $this->_ensureDirExists($this->_initParams[$dirs][DirectoryList::VAR_DIR][DirectoryList::PATH]); $this->copyAppConfigFiles(); + $this->copyGlobalConfigFile(); $installParams = $this->getInstallCliParams(); @@ -557,6 +558,17 @@ private function copyAppConfigFiles() } } } + + /** + * Copies global configuration file from the tests folder (see TESTS_GLOBAL_CONFIG_FILE) + * + * @return void + */ + private function copyGlobalConfigFile() + { + $targetFile = $this->_configDir . '/config.local.php'; + copy($this->globalConfigFile, $targetFile); + } /** * Gets a list of CLI params for installation diff --git a/dev/tests/integration/testsuite/Magento/Integration/Model/Config/Consolidated/_files/integration.php b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/Consolidated/_files/integration.php index cc2841f1acf2c..d72a1359dfa52 100644 --- a/dev/tests/integration/testsuite/Magento/Integration/Model/Config/Consolidated/_files/integration.php +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/Consolidated/_files/integration.php @@ -9,6 +9,7 @@ 'endpoint_url' => 'http://example.com/endpoint1', 'identity_link_url' => 'http://www.example.com/identity1', 'resource' => [ + 'Magento_Backend::admin', 'Magento_Customer::customer', 'Magento_Customer::manage', 'Magento_Sales::sales', @@ -26,6 +27,7 @@ 'endpoint_url' => 'http://example.com/integration2', 'identity_link_url' => 'http://www.example.com/identity2', 'resource' => [ + 'Magento_Backend::admin', 'Magento_Sales::sales', 'Magento_Sales::sales_operation', 'Magento_Sales::sales_order', @@ -40,6 +42,7 @@ 'TestIntegration3' => [ 'email' => 'test-integration3@example.com', 'resource' => [ + 'Magento_Backend::admin', 'Magento_Sales::sales', 'Magento_Sales::sales_operation', 'Magento_Sales::sales_order', diff --git a/dev/tests/integration/testsuite/Magento/Integration/Model/ConfigBasedIntegrationManagerTest.php b/dev/tests/integration/testsuite/Magento/Integration/Model/ConfigBasedIntegrationManagerTest.php new file mode 100644 index 0000000000000..ee14b3ba53dd8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/ConfigBasedIntegrationManagerTest.php @@ -0,0 +1,126 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->consolidatedMock = $this->createMock(\Magento\Integration\Model\ConsolidatedConfig::class); + $this->objectManager->addSharedInstance( + $this->consolidatedMock, + \Magento\Integration\Model\ConsolidatedConfig::class + ); + $this->integrationManager = $this->objectManager->create( + \Magento\Integration\Model\ConfigBasedIntegrationManager::class, + [] + ); + $this->integrationService = $this->objectManager->create( + \Magento\Integration\Api\IntegrationServiceInterface::class, + [] + ); + } + + /** + * @inheritdoc + */ + protected function tearDown() + { + $this->objectManager->removeSharedInstance(\Magento\Integration\Model\ConsolidatedConfig::class); + parent::tearDown(); + } + + /** + * @magentoDbIsolation enabled + */ + public function testProcessConfigBasedIntegrations() + { + $newIntegrations = require __DIR__ . '/Config/Consolidated/_files/integration.php'; + $this->consolidatedMock + ->expects($this->any()) + ->method('getIntegrations') + ->willReturn($newIntegrations); + + // Check that the integrations do not exist already + foreach ($newIntegrations as $integrationName => $integrationData) { + $integration = $this->integrationService->findByName($integrationName); + $this->assertEquals(null, $integration->getId(), 'Integration already exists'); + } + + // Create new integrations + $this->assertEquals( + $newIntegrations, + $this->integrationManager->processConfigBasedIntegrations($newIntegrations), + 'Error processing config based integrations.' + ); + $createdIntegrations = []; + + // Check that the integrations are new with "inactive" status + foreach ($newIntegrations as $integrationName => $integrationData) { + $integration = $this->integrationService->findByName($integrationName); + $this->assertNotEmpty($integration->getId(), 'Integration was not created'); + $this->assertEquals( + $integration::STATUS_INACTIVE, + $integration->getStatus(), + 'Integration is not created with "inactive" status' + ); + $createdIntegrations[$integrationName] = $integration; + } + + // Rerun integration creation with the same data (data has not changed) + $this->assertEquals( + $newIntegrations, + $this->integrationManager->processConfigBasedIntegrations($newIntegrations), + 'Error processing config based integrations.' + ); + + // Check that the integrations are not recreated when data has not actually changed + foreach ($newIntegrations as $integrationName => $integrationData) { + $integration = $this->integrationService->findByName($integrationName); + $this->assertEquals( + $createdIntegrations[$integrationName]->getId(), + $integration->getId(), + 'Integration ID has changed' + ); + $this->assertEquals( + $createdIntegrations[$integrationName]->getStatus(), + $integration->getStatus(), + 'Integration status has changed' + ); + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php new file mode 100644 index 0000000000000..15d10c2ddffd4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php @@ -0,0 +1,48 @@ +get(ManagerInterface::class); + $response = new DataObject(); + $response->setTypes([]); + + $eventManager->dispatch( + 'adminhtml_product_attribute_types', + ['response' => $response] + ); + + $responseTypes = $response->getTypes(); + + self::assertGreaterThan(0, count($responseTypes)); + + /* Iterate through values since other types (not swatches) might be added by observers */ + $responseTypeValues = []; + foreach ($responseTypes as $responseType) { + $responseTypeValues[] = $responseType['value']; + } + + self::assertTrue(in_array(Swatch::SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT, $responseTypeValues)); + self::assertTrue(in_array(Swatch::SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT, $responseTypeValues)); + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php index 81088522bccb2..a4baacbe4d169 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php @@ -96,35 +96,6 @@ function ($file) { ); } - public function testAppCodeUsage() - { - $files = Files::init(); - $componentRegistrar = new ComponentRegistrar(); - $libPaths = $componentRegistrar->getPaths(ComponentRegistrar::LIBRARY); - $invoker = new AggregateInvoker($this); - $invoker( - function ($file) use ($libPaths) { - $content = file_get_contents($file); - foreach ($libPaths as $libPath) { - if (strpos($file, $libPath) === 0) { - $this->assertSame( - 0, - preg_match('~(?|function\\s)__\\s*\\(~iS', $content), - 'Function __() is defined outside of the library and must not be used there. ' . - 'Replacement suggestion: new \\Magento\\Framework\\Phrase()' - ); - } - } - }, - $files->getPhpFiles( - Files::INCLUDE_PUB_CODE | - Files::INCLUDE_LIBS | - Files::AS_DATA_SET | - Files::INCLUDE_NON_CLASSES - ) - ); - } - /** * @inheritdoc */ diff --git a/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php index a1f5acb4e60e7..49d824a4f2e5a 100644 --- a/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php +++ b/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php @@ -8,6 +8,9 @@ use Magento\Framework\Convert\ConvertArray; use Magento\Framework\Reflection\DataObjectProcessor; +/** + * Data object converter. + */ class SimpleDataObjectConverter { /** @@ -156,14 +159,13 @@ public static function snakeCaseToUpperCamelCase($input) */ public static function snakeCaseToCamelCase($input) { - return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $input)))); + return lcfirst(self::snakeCaseToUpperCamelCase($input)); } /** * Convert a CamelCase string read from method into field key in snake_case * - * e.g. DefaultShipping => default_shipping - * Postcode => postcode + * For example [DefaultShipping => default_shipping, Postcode => postcode] * * @param string $name * @return string diff --git a/lib/internal/Magento/Framework/App/Request/DataPersistor.php b/lib/internal/Magento/Framework/App/Request/DataPersistor.php index bb3740aceb010..f0b8819621a1e 100644 --- a/lib/internal/Magento/Framework/App/Request/DataPersistor.php +++ b/lib/internal/Magento/Framework/App/Request/DataPersistor.php @@ -5,8 +5,12 @@ */ namespace Magento\Framework\App\Request; +use Magento\Framework\Api\SimpleDataObjectConverter; use Magento\Framework\Session\SessionManagerInterface; +/** + * Persist data to session. + */ class DataPersistor implements DataPersistorInterface { /** @@ -32,7 +36,7 @@ public function __construct( */ public function set($key, $data) { - $method = 'set' . ucfirst($key) . 'Data'; + $method = 'set' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($key) . 'Data'; call_user_func_array([$this->session, $method], [$data]); } @@ -44,7 +48,7 @@ public function set($key, $data) */ public function get($key) { - $method = 'get' . ucfirst($key) . 'Data'; + $method = 'get' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($key) . 'Data'; return call_user_func_array([$this->session, $method], []); } @@ -56,7 +60,7 @@ public function get($key) */ public function clear($key) { - $method = 'uns' . ucfirst($key) . 'Data'; + $method = 'uns' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($key) . 'Data'; call_user_func_array([$this->session, $method], []); } } diff --git a/lib/internal/Magento/Framework/Archive/Tar.php b/lib/internal/Magento/Framework/Archive/Tar.php index 7fe1255e5b859..a858b2411515a 100644 --- a/lib/internal/Magento/Framework/Archive/Tar.php +++ b/lib/internal/Magento/Framework/Archive/Tar.php @@ -4,15 +4,15 @@ * See COPYING.txt for license details. */ +namespace Magento\Framework\Archive; + +use Magento\Framework\Archive\Helper\File; + /** * Class to work with tar archives * * @author Magento Core Team */ -namespace Magento\Framework\Archive; - -use Magento\Framework\Archive\Helper\File; - class Tar extends \Magento\Framework\Archive\AbstractArchive implements \Magento\Framework\Archive\ArchiveInterface { /** @@ -259,10 +259,7 @@ protected function _createTar($skipRoot = false, $finalize = false) ); } - array_shift($dirFiles); - /* remove './'*/ - array_shift($dirFiles); - /* remove '../'*/ + $dirFiles = array_diff($dirFiles, ['..', '.']); foreach ($dirFiles as $item) { $this->_setCurrentFile($file . $item)->_createTar(); diff --git a/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php b/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php index 30b2a370bcb42..96f9674704e17 100644 --- a/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php +++ b/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php @@ -121,7 +121,7 @@ private function getGroupedDbVersionErrors() (array)$allDbVersionErrors, function ($carry, $item) { if ($item[DbVersionInfo::KEY_CURRENT] === 'none' - || $item[DbVersionInfo::KEY_CURRENT] < $item[DbVersionInfo::KEY_REQUIRED] + || version_compare($item[DbVersionInfo::KEY_CURRENT], $item[DbVersionInfo::KEY_REQUIRED], '<') ) { $carry['version_too_low'][] = $item; } else { diff --git a/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php b/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php index a52c49136d150..5027bfae606a6 100644 --- a/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php @@ -157,29 +157,29 @@ public static function beforeDispatchOutOfDateWithErrorsDataProvider() [ DbVersionInfo::KEY_MODULE => 'Magento_Module4', DbVersionInfo::KEY_TYPE => 'data', - DbVersionInfo::KEY_CURRENT => '1.0.1', - DbVersionInfo::KEY_REQUIRED => '1.0.0' + DbVersionInfo::KEY_CURRENT => '1.0.10', + DbVersionInfo::KEY_REQUIRED => '1.0.9' ], ], 'expectedMessage' => "Please update your modules: " . "Run \"composer install\" from the Magento root directory.\n" . "The following modules are outdated:\n" . "Magento_Module3 schema: code version - 1.0.0, database version - 2.0.0\n" - . "Magento_Module4 data: code version - 1.0.0, database version - 1.0.1", + . "Magento_Module4 data: code version - 1.0.9, database version - 1.0.10", ], 'some versions too high, some too low' => [ 'errors' => [ [ - DbVersionInfo::KEY_MODULE => 'Magento_Module1', + DbVersionInfo::KEY_MODULE => 'Magento_Module2', DbVersionInfo::KEY_TYPE => 'schema', - DbVersionInfo::KEY_CURRENT => '2.0.0', - DbVersionInfo::KEY_REQUIRED => '1.0.0' + DbVersionInfo::KEY_CURRENT => '1.9.0', + DbVersionInfo::KEY_REQUIRED => '1.12.0' ], [ - DbVersionInfo::KEY_MODULE => 'Magento_Module2', + DbVersionInfo::KEY_MODULE => 'Magento_Module1', DbVersionInfo::KEY_TYPE => 'schema', - DbVersionInfo::KEY_CURRENT => '1.0.0', - DbVersionInfo::KEY_REQUIRED => '2.0.0' + DbVersionInfo::KEY_CURRENT => '2.0.0', + DbVersionInfo::KEY_REQUIRED => '1.0.0' ], ], 'expectedMessage' => "Please update your modules: " diff --git a/lib/internal/Magento/Framework/View/Element/Html/Link/Current.php b/lib/internal/Magento/Framework/View/Element/Html/Link/Current.php index ab1bca9f4548c..43bfd46c1193a 100644 --- a/lib/internal/Magento/Framework/View/Element/Html/Link/Current.php +++ b/lib/internal/Magento/Framework/View/Element/Html/Link/Current.php @@ -104,13 +104,13 @@ protected function _toHtml() if ($this->isCurrent()) { $html = ''; } else { $html = '