diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index c2e9fa9cef24..ba46c6e72cf5 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -1,4 +1,4 @@ -# Magento Code of Conduct +# Mage-OS Code of Conduct ## Our Pledge diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d3fd535a6d57..500066abf97e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,13 +1,13 @@ # Contributing to Magento 2 code -Contributions to the Magento 2 codebase are done using the fork & pull model. -This contribution model has contributors maintaining their own fork of the Magento 2 repository. +Contributions to the Mage-OS Magento 2 codebase are done using the fork & pull model. +This contribution model has contributors maintaining their own fork of the Mage-OS Magento 2 repository. The forked repository is then used to submit a request to the base repository to "pull" a set of changes. For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/). Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes or optimizations. -The Magento 2 development team or community maintainers will review all issues and contributions submitted by the community of developers in the first in, first out order. +The Mage-OS Magento 2 development team or community maintainers will review all issues and contributions submitted by the community of developers in the first in, first out order. During the review we might require clarifications from the contributor. If there is no response from the contributor within two weeks, the pull request will be closed. @@ -17,24 +17,24 @@ For more detailed information on contribution please read our [beginners guide]( 1. Contributions must adhere to the [Magento coding standards](https://developer.adobe.com/commerce/php/coding-standards/). 2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests. -3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information. +3. Commits must be accompanied by meaningful commit messages. Please see the [Mage-OS Magento Pull Request Template](https://github.com/mage-os/mageos-magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information. 4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug. 5. PRs which include new logic or new features must be submitted along with: * Unit/integration test coverage * Proposed [documentation](https://developer.adobe.com/commerce) updates. Use feedback buttons __Edit in GitHub__ and __Log an issue__ at the top of a relevant topic. -6. For larger features or changes, please [open an issue](https://github.com/magento/magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input. +6. For larger features or changes, please [open an issue](https://github.com/mage-os/mageos-magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input. 7. All automated tests must pass. ## Contribution process If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free). -This will allow you to collaborate with the Magento 2 development team, fork the Magento 2 project and send pull requests. +This will allow you to collaborate with the Mage-OS Magento 2 development team, fork the Mage-OS Magento 2 project and send pull requests. -1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution. +1. Search current [listed issues](https://github.com/mage-os/mageos-magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution. 2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing. 3. Create and test your work. -4. Follow the [Forks And Pull Requests Instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) to fork the Magento 2 repository and send us a pull request. -5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed. +4. Follow the [Forks And Pull Requests Instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) to fork the Mage-OS Magento 2 repository and send us a pull request. +5. Once your contribution is received the Mage-OS Magento 2 development team will review the contribution and collaborate with you as needed. ## Code of Conduct diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2b1720ccaaba..bfa885e59552 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,5 @@ 1. 2. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index d4e0707f7ede..71e60ce0f473 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,5 +1,5 @@ name: Bug report -description: Technical issue with the Magento 2 core components +description: Technical issue with the Mage-OS Magento 2 core components body: - type: markdown attributes: @@ -12,7 +12,7 @@ body: Describe your environment. Provide all the details that will help us to reproduce the bug. value: | - - Magento version + - Mage-OS Magento version - Anything else that would help a developer reproduce the bug - type: textarea attributes: @@ -51,7 +51,7 @@ body: attributes: label: Additional information description: | - Additional information is often requested when the bug report is processed. You can save time by providing both Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue. + Additional information is often requested when the bug report is processed. You can save time by providing both Mage-OS Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue. Also, links to the comments with important information, Root Cause analysis, additional video recordings; and anything else that is important for the issue and at some reason cannot be added to other sections. - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b6b7491ada86..3c0a463e44d8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -5,7 +5,7 @@ body: - type: markdown attributes: value: | - Important: This repository is intended only for Magento 2 Technical Issues. + Important: This repository is intended only for Mage-OS Magento 2 Technical Issues. Enter Feature Requests at https://github.com/magento/community-features. Project stakeholders monitor and manage requests. Feature requests entered using this form may be moved to the forum. @@ -28,7 +28,7 @@ body: attributes: label: Benefits description: | - How do you think this feature would improve Magento? + How do you think this feature would improve Mage-OS Magento? - type: textarea attributes: label: Additional information diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fd2f7f1badc2..5dc88d3d9b01 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ -1. Fixes magento/magento2# +1. Fixes mage-os/mageos-magento2# ### Manual testing scenarios (*) + Magento\AdminAnalytics\ViewModel\Metadata diff --git a/app/code/Magento/Backend/i18n/en_US.csv b/app/code/Magento/Backend/i18n/en_US.csv index b72db96d6a59..64ce31433b19 100644 --- a/app/code/Magento/Backend/i18n/en_US.csv +++ b/app/code/Magento/Backend/i18n/en_US.csv @@ -240,7 +240,10 @@ password,password "Reload Data","Reload Data" "Browse Files...","Browse Files..." Magento,Magento +"Mage-OS","Mage-OS" "Copyright © %1 Magento Commerce Inc. All rights reserved.","Copyright © %1 Magento Commerce Inc. All rights reserved." +"Thank you for choosing Mage-OS.","Thank you for choosing Mage-OS." +"Learn more about Mage-OS.","Learn more about Mage-OS." "ver. %1","ver. %1" "Magento Admin Panel","Magento Admin Panel" "Account Setting","Account Setting" diff --git a/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml b/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml index 9ddcb0f3b3bb..85e184df0d49 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml @@ -24,7 +24,7 @@ - images/magento-logo.svg + images/mage-os-logo.svg diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index 6e04bd867576..25465f6ce090 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -25,7 +25,7 @@ logo Community Edition - images/magento-icon.svg + images/mage-os-icon.svg @@ -62,12 +62,12 @@ - https://www.adobe.com/privacy/policy.html + https://mage-os.org/privacy-policy - https://github.com/magento/magento2/issues + https://github.com/mage-os/mageos-magento2/issues diff --git a/app/code/Magento/Backend/view/adminhtml/templates/page/copyright.phtml b/app/code/Magento/Backend/view/adminhtml/templates/page/copyright.phtml index e3a5c84ea452..293fe82b7f09 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/page/copyright.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/page/copyright.phtml @@ -3,6 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +use Magento\Backend\Block\Page\Copyright; +use Magento\Framework\Escaper; + +/** @var Escaper $escaper */ +/** @var Copyright $block */ ?> - -escapeHtml(__('Copyright © %1 Magento Commerce Inc. All rights reserved.', date('Y'))) ?> +escapeHtml(__('Thank you for choosing Mage-OS.')); ?> + + escapeHtml(__('Learn more about Mage-OS.')); ?> + diff --git a/app/code/Magento/Backend/view/adminhtml/templates/page/footer.phtml b/app/code/Magento/Backend/view/adminhtml/templates/page/footer.phtml index 3f21dcda9a54..7b1f14d28a50 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/page/footer.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/page/footer.phtml @@ -3,8 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +use Magento\Backend\Block\Page\Footer; +use Magento\Framework\Escaper; + +/** @var Escaper $escaper */ +/** @var Footer $block */ ?>

- escapeHtml(__('Magento')) ?> - escapeHtml(__('ver. %1', $block->getMagentoVersion())) ?> + escapeHtml(__('Mage-OS')); ?> + escapeHtml(__('ver. %1', $block->getMagentoVersion())); ?>

diff --git a/app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml b/app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml index 89f144664003..f5d9172a51c4 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml @@ -3,62 +3,74 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); -/** @var $block \Magento\Backend\Block\Page\Header */ +use Magento\Backend\Block\Page\Header; +use Magento\Framework\Escaper; + +/** @var Escaper $escaper */ +/** @var Header $block */ $part = $block->getShowPart(); ?> - - hasEdition() ? 'data-edition="' . $block->escapeHtml($block->getEdition()) . '"' : ''; ?> - hasLogoImageSrc()) ? $block->escapeHtml($block->getLogoImageSrc()) : 'images/magento-logo.svg' ?> - - class="logo"> - <?= $block->escapeHtml(__('Magento Admin Panel')) ?> - - - + + getChildHtml(); ?> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php index b6f5fdfef134..c5dd592176c6 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php @@ -44,7 +44,8 @@ '', [ - "Element 'option', attribute 'renderer': '123true' is not a valid value of the atomic type 'modelName'.\n" . + "Element 'option', attribute 'renderer': [facet 'pattern'] The value '123true' is not accepted " . + "by the pattern '([\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\n" . "Line: 1\nThe xml was: \n0:\n1:\n2:\n" ], diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php index 88d950104bfb..9bc8f5451b37 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php @@ -32,7 +32,8 @@ 'type_modelinstance_invalid_value' => [ '', [ - "Element 'type', attribute 'modelInstance': '123' is not a valid value of the atomic type 'modelName'.\n" . + "Element 'type', attribute 'modelInstance': [facet 'pattern'] The value '123' is not " . + "accepted by the pattern '([\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\n" . "Line: 1\nThe xml was: \n0:\n1:\n2:\n" ], @@ -71,16 +72,18 @@ 'type_pricemodel_instance_invalid_value' => [ '', [ - "Element 'priceModel', attribute 'instance': '123123' is not a valid value of the atomic " . - "type 'modelName'.\nLine: 1\nThe xml was: \n0:\n1:\n1:\n2:\n" ], ], 'type_indexermodel_instance_invalid_value' => [ '', [ - "Element 'indexerModel', attribute 'instance': '123' is not a valid value of the atomic type " . - "'modelName'.\nLine: 1\nThe xml was: \n0:\n1:\n1:\n2:\n" ], ], @@ -102,8 +105,9 @@ 'stockindexermodel_instance_invalid_value' => [ '', [ - "Element 'stockIndexerModel', attribute 'instance': '1234' is not a valid value of the atomic type " . - "'modelName'.\nLine: 1\nThe xml was: \n0:\n1:\n1:\n2:\n" ], ], diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php index f994bb8fe26a..bb2e6a23f3ff 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php @@ -162,7 +162,9 @@ public function lockProductsStock(array $productIds, $websiteId) $items[$si['product_id']] = $si; } foreach ($this->getConnection()->fetchAll($selectProducts) as $p) { - $items[$p['product_id']]['type_id'] = $p['type_id']; + if (isset($items[$p['product_id']])) { + $items[$p['product_id']]['type_id'] = $p['type_id']; + } } return $items; diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php b/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php index 82e25361b0e5..eef006ea054d 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php @@ -90,7 +90,8 @@ "1:
co
\n2:\n", - "Element 'config_path': 'co' is not a valid value of the atomic type 'typeConfigPath'.\nLine: 1\n" . + "Element 'config_path': [facet 'minLength'] The value has a length of '2'; " . + "this underruns the allowed minimum length of '5'.\nLine: 1\n" . "The xml was: \n0:\n1:
co" . "
\n2:\n" @@ -107,7 +108,8 @@ "1:
Som" . "
\n2:\n", - "Element 'if_module_enabled': 'Som' is not a valid value of the atomic type 'typeModule'.\n" . + "Element 'if_module_enabled': [facet 'minLength'] The value has a length of '3'; " . + "this underruns the allowed minimum length of '5'.\n" . "Line: 1\nThe xml was: \n0:\n1:
" . "Som" . "" . diff --git a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php index caecfd61fa18..6ef5bf8a5e15 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php @@ -138,16 +138,12 @@ function (array $args) { */ public static function getOutputFormatDataProvider(): array { - $ar_DZ = "\u{062C}.\u{0645}.\u{200F}\u{00A0}%s"; - if (version_compare(PHP_VERSION, '8.3', '>=')) { - $ar_DZ = "%s\u{00A0}\u{062C}.\u{0645}.\u{200F}"; - } return [ 'en_US:USD' => ['en_US', 'USD', '$%s'], 'en_US:PLN' => ['en_US', 'PLN', "PLN\u{00A0}%s"], 'en_US:PKR' => ['en_US', 'PKR', "PKR\u{00A0}%s"], 'af_ZA:VND' => ['af_ZA', 'VND', "\u{20AB}%s"], - 'ar_DZ:EGP' => ['ar_DZ', 'EGP', $ar_DZ], + 'ar_DZ:EGP' => ['ar_DZ', 'EGP', "%s\u{00A0}\u{062C}.\u{0645}.\u{200F}"], 'ar_SA:USD' => ['ar_SA', 'USD', "%s\u{00A0}US$"], 'ar_SA:LBP' => ['ar_SA', 'LBP', "%s\u{00A0}\u{0644}.\u{0644}.\u{200F}"], 'fa_IR:USD' => ['fa_IR', 'USD', "\u{200E}$%s"], diff --git a/app/code/Magento/Elasticsearch/Model/DataProvider/Base/Suggestions.php b/app/code/Magento/Elasticsearch/Model/DataProvider/Base/Suggestions.php index d16041eef4b5..b4cfb1c80bc1 100644 --- a/app/code/Magento/Elasticsearch/Model/DataProvider/Base/Suggestions.php +++ b/app/code/Magento/Elasticsearch/Model/DataProvider/Base/Suggestions.php @@ -8,7 +8,9 @@ use Elasticsearch\Common\Exceptions\BadRequest400Exception; use Exception; use Magento\AdvancedSearch\Model\SuggestedQueriesInterface; +use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProviderInterface; +use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface; use Magento\Elasticsearch\Model\Config; use Magento\Elasticsearch\SearchAdapter\ConnectionManager; use Magento\Elasticsearch\SearchAdapter\SearchIndexNameResolver; @@ -61,6 +63,16 @@ class Suggestions implements SuggestedQueriesInterface */ private $fieldProvider; + /** + * @var CollectionFactory + */ + private $productAttributeCollectionFactory; + + /** + * @var FieldMapperInterface + */ + private $fieldMapper; + /** * @var LoggerInterface */ @@ -90,6 +102,8 @@ class Suggestions implements SuggestedQueriesInterface * @param FieldProviderInterface $fieldProvider * @param LoggerInterface|null $logger * @param GetSuggestionFrequencyInterface|null $getSuggestionFrequency + * @param CollectionFactory|null $productAttributeCollectionFactory + * @param FieldMapperInterface|null $fieldMapper * @param array $responseErrorExceptionList * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -103,6 +117,8 @@ public function __construct( FieldProviderInterface $fieldProvider, LoggerInterface $logger = null, ?GetSuggestionFrequencyInterface $getSuggestionFrequency = null, + ?CollectionFactory $productAttributeCollectionFactory = null, + ?FieldMapperInterface $fieldMapper = null, array $responseErrorExceptionList = [] ) { $this->queryResultFactory = $queryResultFactory; @@ -111,10 +127,13 @@ public function __construct( $this->config = $config; $this->searchIndexNameResolver = $searchIndexNameResolver; $this->storeManager = $storeManager; - $this->fieldProvider = $fieldProvider; $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); $this->getSuggestionFrequency = $getSuggestionFrequency ?: ObjectManager::getInstance()->get(GetSuggestionFrequencyInterface::class); + $this->productAttributeCollectionFactory = $productAttributeCollectionFactory ?: + ObjectManager::getInstance()->get(CollectionFactory::class); + $this->fieldMapper = $fieldMapper ?: + ObjectManager::getInstance()->get(FieldMapperInterface::class); $this->responseErrorExceptionList = array_merge($this->responseErrorExceptionList, $responseErrorExceptionList); } @@ -281,11 +300,20 @@ private function addSuggestFields($searchQuery, $searchSuggestionsCount) */ private function getSuggestFields() { - $fields = array_filter($this->fieldProvider->getFields(), function ($field) { - return (($field['type'] ?? null) === 'text') && (($field['index'] ?? null) !== false); - }); - - return array_keys($fields); + $productAttributes = $this->productAttributeCollectionFactory->create(); + $productAttributes->addFieldToFilter( + 'is_searchable', + 1 + ); + $attributeCodes = $productAttributes->getColumnValues('attribute_code'); + $fields = []; + foreach ($attributeCodes as $attributeCode) { + $fields[] = $this->fieldMapper->getFieldName( + $attributeCode, + ['type' => FieldMapperInterface::TYPE_QUERY] + ); + } + return $fields; } /** diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php index 3309e40402fc..204511507f76 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php @@ -143,8 +143,9 @@ public static function mergedXmlDataProvider() 'node "template" with invalid attribute "area"' => [ '