Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read
-
+
Magento System Requirements.
HTML;
@@ -31,8 +31,6 @@
// Sets default autoload mappings, may be overridden in Bootstrap::create
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
-require_once BP . '/app/functions.php';
-
/* Custom umask value may be provided in optional mage_umask file in root */
$umaskFile = BP . '/magento_umask';
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
@@ -49,12 +47,21 @@
unset($_SERVER['ORIG_PATH_INFO']);
}
-if (!empty($_SERVER['MAGE_PROFILER'])
+if (
+ (!empty($_SERVER['MAGE_PROFILER']) || file_exists(BP . '/var/profiler.flag'))
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
) {
- \Magento\Framework\Profiler::applyConfig(
- $_SERVER['MAGE_PROFILER'],
+ $profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
+ ? $_SERVER['MAGE_PROFILER']
+ : trim(file_get_contents(BP . '/var/profiler.flag'));
+
+ if ($profilerConfig) {
+ $profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
+ }
+
+ Magento\Framework\Profiler::applyConfig(
+ $profilerConfig,
BP,
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
);
diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php
index 79f69ab5da88d..6b5e0681139cf 100644
--- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php
+++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php
@@ -28,11 +28,11 @@ public function execute()
)->markAsRead(
$notificationId
);
- $this->messageManager->addSuccess(__('The message has been marked as Read.'));
+ $this->messageManager->addSuccessMessage(__('The message has been marked as Read.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
- $this->messageManager->addException(
+ $this->messageManager->addExceptionMessage(
$e,
__("We couldn't mark the notification as Read because of an error.")
);
diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php
index 9e61b8ff4b83c..9ae4a7cdac0b9 100644
--- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php
+++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php
@@ -23,7 +23,7 @@ public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
- $this->messageManager->addError(__('Please select messages.'));
+ $this->messageManager->addErrorMessage(__('Please select messages.'));
} else {
try {
foreach ($ids as $id) {
@@ -32,13 +32,13 @@ public function execute()
$model->setIsRead(1)->save();
}
}
- $this->messageManager->addSuccess(
+ $this->messageManager->addSuccessMessage(
__('A total of %1 record(s) have been marked as Read.', count($ids))
);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
- $this->messageManager->addException(
+ $this->messageManager->addExceptionMessage(
$e,
__("We couldn't mark the notification as Read because of an error.")
);
diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php
index 6c0dfd1db7d16..f4cafa09c7e45 100644
--- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php
+++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php
@@ -23,7 +23,7 @@ public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
- $this->messageManager->addError(__('Please select messages.'));
+ $this->messageManager->addErrorMessage(__('Please select messages.'));
} else {
try {
foreach ($ids as $id) {
@@ -32,13 +32,14 @@ public function execute()
$model->setIsRemove(1)->save();
}
}
- $this->messageManager->addSuccess(__('Total of %1 record(s) have been removed.', count($ids)));
+ $this->messageManager->addSuccessMessage(__('Total of %1 record(s) have been removed.', count($ids)));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
- $this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
+ $this->messageManager
+ ->addExceptionMessage($e, __("We couldn't remove the messages because of an error."));
}
}
- $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
+ $this->_redirect('adminhtml/*/');
}
}
diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php
index 17f911339cb61..bec101fc27d48 100644
--- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php
+++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php
@@ -31,11 +31,12 @@ public function execute()
try {
$model->setIsRemove(1)->save();
- $this->messageManager->addSuccess(__('The message has been removed.'));
+ $this->messageManager->addSuccessMessage(__('The message has been removed.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
- $this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
+ $this->messageManager
+ ->addExceptionMessage($e, __("We couldn't remove the messages because of an error."));
}
$this->_redirect('adminhtml/*/');
diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php
index c332440276083..6088afbc2e1a4 100644
--- a/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php
+++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php
@@ -59,8 +59,10 @@ public function execute()
if (empty($result)) {
$result[] = [
'severity' => (string)\Magento\Framework\Notification\MessageInterface::SEVERITY_NOTICE,
- 'text' => 'You have viewed and resolved all recent system notices. '
- . 'Please refresh the web page to clear the notice alert.',
+ 'text' => __(
+ 'You have viewed and resolved all recent system notices. '
+ . 'Please refresh the web page to clear the notice alert.'
+ )
];
}
$this->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
diff --git a/app/code/Magento/AdminNotification/Test/Mftf/LICENSE.txt b/app/code/Magento/AdminNotification/Test/Mftf/LICENSE.txt
new file mode 100644
index 0000000000000..49525fd99da9c
--- /dev/null
+++ b/app/code/Magento/AdminNotification/Test/Mftf/LICENSE.txt
@@ -0,0 +1,48 @@
+
+Open Software License ("OSL") v. 3.0
+
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+
+Licensed under the Open Software License version 3.0
+
+ 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+
+ 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
+
+ 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+
+ 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
+
+ 4. to perform the Original Work publicly; and
+
+ 5. to display the Original Work publicly.
+
+ 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+
+ 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+
+ 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+
+ 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+
+ 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+ 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+
+ 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+
+ 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+
+ 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+ 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+
+ 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+ 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+ 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+ 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+ 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Advanced Reporting in included,
+ free of charge, in your Magento software. When you opt out, we collect no product, order, and
+ customer data to generate our dynamic reports. To opt in later: You can always turn on Advanced
+ Reporting in you Admin Panel. Advanced Reporting in included,
+ free of charge, in your Magento software. When you opt out, we collect no product, order, and
+ customer data to generate our dynamic reports. To opt in later: You can always turn on Advanced
+ Reporting in you Admin Panel. ',
+ $element->getHtmlId(),
+ $html
+ );
+ }
+}
diff --git a/app/code/Magento/Analytics/Block/Adminhtml/System/Config/CollectionTimeLabel.php b/app/code/Magento/Analytics/Block/Adminhtml/System/Config/CollectionTimeLabel.php
new file mode 100644
index 0000000000000..34f2b7d53d9be
--- /dev/null
+++ b/app/code/Magento/Analytics/Block/Adminhtml/System/Config/CollectionTimeLabel.php
@@ -0,0 +1,53 @@
+localeResolver = $localeResolver ?:
+ ObjectManager::getInstance()->get(\Magento\Framework\Locale\ResolverInterface::class);
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Add current time zone to comment, properly translated according to locale
+ *
+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * @return string
+ */
+ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
+ {
+ $timeZoneCode = $this->_localeDate->getConfigTimezone();
+ $locale = $this->localeResolver->getLocale();
+ $getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)
+ ->getDisplayName(false, \IntlTimeZone::DISPLAY_LONG, $locale);
+ $element->setData(
+ 'comment',
+ sprintf("%s (%s)", $getLongTimeZoneName, $timeZoneCode)
+ );
+ return parent::render($element);
+ }
+}
diff --git a/app/code/Magento/Analytics/Block/Adminhtml/System/Config/SubscriptionStatusLabel.php b/app/code/Magento/Analytics/Block/Adminhtml/System/Config/SubscriptionStatusLabel.php
new file mode 100644
index 0000000000000..c09213c7f009d
--- /dev/null
+++ b/app/code/Magento/Analytics/Block/Adminhtml/System/Config/SubscriptionStatusLabel.php
@@ -0,0 +1,64 @@
+subscriptionStatusProvider = $labelStatusProvider;
+ }
+
+ /**
+ * Add Subscription status to comment
+ *
+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * @return string
+ */
+ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
+ {
+ $element->setData(
+ 'comment',
+ $this->prepareLabelValue()
+ );
+ return parent::render($element);
+ }
+
+ /**
+ * Prepare label for subscription status
+ *
+ * @return string
+ */
+ private function prepareLabelValue()
+ {
+ return __('Subscription status') . ': ' . __($this->subscriptionStatusProvider->getStatus());
+ }
+}
diff --git a/app/code/Magento/Analytics/Block/Adminhtml/System/Config/Vertical.php b/app/code/Magento/Analytics/Block/Adminhtml/System/Config/Vertical.php
new file mode 100644
index 0000000000000..99606e10f99d9
--- /dev/null
+++ b/app/code/Magento/Analytics/Block/Adminhtml/System/Config/Vertical.php
@@ -0,0 +1,41 @@
+' . $element->getHint() . '';
+ $html .= ' ', $html);
+ $rowHtml .= sprintf(
+ '%s ',
+ $element->getHtmlId(),
+ $element->getLabelHtml($element->getHtmlId(), "[WEBSITE]"),
+ $element->getElementHtml()
+ );
+ return $rowHtml;
+ }
+}
diff --git a/app/code/Magento/Analytics/Controller/Adminhtml/BIEssentials/SignUp.php b/app/code/Magento/Analytics/Controller/Adminhtml/BIEssentials/SignUp.php
new file mode 100644
index 0000000000000..a90a971cf41b4
--- /dev/null
+++ b/app/code/Magento/Analytics/Controller/Adminhtml/BIEssentials/SignUp.php
@@ -0,0 +1,64 @@
+config = $config;
+ parent::__construct($context);
+ }
+
+ /**
+ * Check admin permissions for this controller
+ *
+ * @return boolean
+ */
+ protected function _isAllowed()
+ {
+ return $this->_authorization->isAllowed('Magento_Analytics::bi_essentials');
+ }
+
+ /**
+ * Provides link to BI Essentials signup
+ *
+ * @return \Magento\Framework\Controller\AbstractResult
+ */
+ public function execute()
+ {
+ return $this->resultRedirectFactory->create()->setUrl(
+ $this->config->getValue($this->urlBIEssentialsConfigPath)
+ );
+ }
+}
diff --git a/app/code/Magento/Analytics/Controller/Adminhtml/Reports/Show.php b/app/code/Magento/Analytics/Controller/Adminhtml/Reports/Show.php
new file mode 100644
index 0000000000000..1b0e5c92420de
--- /dev/null
+++ b/app/code/Magento/Analytics/Controller/Adminhtml/Reports/Show.php
@@ -0,0 +1,75 @@
+reportUrlProvider = $reportUrlProvider;
+ parent::__construct($context);
+ }
+
+ /**
+ * Check admin permissions for this controller.
+ *
+ * @return boolean
+ */
+ protected function _isAllowed()
+ {
+ return $this->_authorization->isAllowed('Magento_Analytics::analytics_settings');
+ }
+
+ /**
+ * Redirect to resource with reports.
+ *
+ * @return Redirect $resultRedirect
+ */
+ public function execute()
+ {
+ /** @var Redirect $resultRedirect */
+ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
+ try {
+ $resultRedirect->setUrl($this->reportUrlProvider->getUrl());
+ } catch (SubscriptionUpdateException $e) {
+ $this->getMessageManager()->addNoticeMessage($e->getMessage());
+ $resultRedirect->setPath('adminhtml');
+ } catch (LocalizedException $e) {
+ $this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
+ $resultRedirect->setPath('adminhtml');
+ } catch (\Exception $e) {
+ $this->getMessageManager()->addExceptionMessage(
+ $e,
+ __('Sorry, there has been an error processing your request. Please try again later.')
+ );
+ $resultRedirect->setPath('adminhtml');
+ }
+
+ return $resultRedirect;
+ }
+}
diff --git a/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Retry.php b/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Retry.php
new file mode 100644
index 0000000000000..122cf74123cc9
--- /dev/null
+++ b/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Retry.php
@@ -0,0 +1,73 @@
+subscriptionHandler = $subscriptionHandler;
+ parent::__construct($context);
+ }
+
+ /**
+ * Check admin permissions for this controller
+ *
+ * @return boolean
+ */
+ protected function _isAllowed()
+ {
+ return $this->_authorization->isAllowed('Magento_Analytics::analytics_settings');
+ }
+
+ /**
+ * Retry process of subscription.
+ *
+ * @return Redirect
+ */
+ public function execute()
+ {
+ /** @var Redirect $resultRedirect */
+ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
+ try {
+ $resultRedirect->setPath('adminhtml');
+ $this->subscriptionHandler->processEnabled();
+ } catch (LocalizedException $e) {
+ $this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
+ } catch (\Exception $e) {
+ $this->getMessageManager()->addExceptionMessage(
+ $e,
+ __('Sorry, there has been an error processing your request. Please try again later.')
+ );
+ }
+
+ return $resultRedirect;
+ }
+}
diff --git a/app/code/Magento/Analytics/Cron/CollectData.php b/app/code/Magento/Analytics/Cron/CollectData.php
new file mode 100644
index 0000000000000..ff0b3e4f67638
--- /dev/null
+++ b/app/code/Magento/Analytics/Cron/CollectData.php
@@ -0,0 +1,53 @@
+exportDataHandler = $exportDataHandler;
+ $this->subscriptionStatus = $subscriptionStatus;
+ }
+
+ /**
+ * @return bool
+ */
+ public function execute()
+ {
+ if ($this->subscriptionStatus->getStatus() === SubscriptionStatusProvider::ENABLED) {
+ $this->exportDataHandler->prepareExportData();
+ }
+
+ return true;
+ }
+}
diff --git a/app/code/Magento/Analytics/Cron/SignUp.php b/app/code/Magento/Analytics/Cron/SignUp.php
new file mode 100644
index 0000000000000..c17b9b8c381c3
--- /dev/null
+++ b/app/code/Magento/Analytics/Cron/SignUp.php
@@ -0,0 +1,101 @@
+connector = $connector;
+ $this->configWriter = $configWriter;
+ $this->flagManager = $flagManager;
+ $this->reinitableConfig = $reinitableConfig;
+ }
+
+ /**
+ * Execute scheduled subscription operation
+ * In case of failure writes message to notifications inbox
+ *
+ * @return bool
+ */
+ public function execute()
+ {
+ $attemptsCount = $this->flagManager->getFlagData(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE);
+
+ if (($attemptsCount === null) || ($attemptsCount <= 0)) {
+ $this->deleteAnalyticsCronExpr();
+ $this->flagManager->deleteFlag(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE);
+ return false;
+ }
+
+ $attemptsCount -= 1;
+ $this->flagManager->saveFlag(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE, $attemptsCount);
+ $signUpResult = $this->connector->execute('signUp');
+ if ($signUpResult === false) {
+ return false;
+ }
+
+ $this->deleteAnalyticsCronExpr();
+ $this->flagManager->deleteFlag(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE);
+ return true;
+ }
+
+ /**
+ * Delete cron schedule setting into config.
+ *
+ * Delete cron schedule setting for subscription handler into config and
+ * re-initialize config cache to avoid auto-generate new schedule items.
+ *
+ * @return bool
+ */
+ private function deleteAnalyticsCronExpr()
+ {
+ $this->configWriter->delete(SubscriptionHandler::CRON_STRING_PATH);
+ $this->reinitableConfig->reinit();
+ return true;
+ }
+}
diff --git a/app/code/Magento/Analytics/Cron/Update.php b/app/code/Magento/Analytics/Cron/Update.php
new file mode 100644
index 0000000000000..9062a7bac7551
--- /dev/null
+++ b/app/code/Magento/Analytics/Cron/Update.php
@@ -0,0 +1,92 @@
+connector = $connector;
+ $this->configWriter = $configWriter;
+ $this->reinitableConfig = $reinitableConfig;
+ $this->flagManager = $flagManager;
+ $this->analyticsToken = $analyticsToken;
+ }
+
+ /**
+ * Execute scheduled update operation
+ *
+ * @return bool
+ */
+ public function execute()
+ {
+ $result = false;
+ $attemptsCount = $this->flagManager
+ ->getFlagData(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);
+
+ if ($attemptsCount) {
+ $attemptsCount -= 1;
+ $result = $this->connector->execute('update');
+ }
+
+ if ($result || ($attemptsCount <= 0) || (!$this->analyticsToken->isTokenExist())) {
+ $this->flagManager
+ ->deleteFlag(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);
+ $this->flagManager->deleteFlag(SubscriptionUpdateHandler::PREVIOUS_BASE_URL_FLAG_CODE);
+ $this->configWriter->delete(SubscriptionUpdateHandler::UPDATE_CRON_STRING_PATH);
+ $this->reinitableConfig->reinit();
+ }
+
+ return $result;
+ }
+}
diff --git a/app/code/Magento/Analytics/LICENSE.txt b/app/code/Magento/Analytics/LICENSE.txt
new file mode 100644
index 0000000000000..49525fd99da9c
--- /dev/null
+++ b/app/code/Magento/Analytics/LICENSE.txt
@@ -0,0 +1,48 @@
+
+Open Software License ("OSL") v. 3.0
+
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+
+Licensed under the Open Software License version 3.0
+
+ 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+
+ 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
+
+ 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+
+ 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
+
+ 4. to perform the Original Work publicly; and
+
+ 5. to display the Original Work publicly.
+
+ 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+
+ 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+
+ 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+
+ 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+
+ 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+ 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+
+ 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+
+ 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+
+ 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+ 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+
+ 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+ 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+ 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+ 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+ 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under %s %s
'
+ . '(' . __('Code') . ': ' . $row->getGroupCode() . ')';
}
}
diff --git a/app/code/Magento/Backend/Block/System/Store/Grid/Render/Store.php b/app/code/Magento/Backend/Block/System/Store/Grid/Render/Store.php
index 23b2de683a958..9cfc8bfc52691 100644
--- a/app/code/Magento/Backend/Block/System/Store/Grid/Render/Store.php
+++ b/app/code/Magento/Backend/Block/System/Store/Grid/Render/Store.php
@@ -27,6 +27,7 @@ public function render(\Magento\Framework\DataObject $row)
$this->getUrl('adminhtml/*/editStore', ['store_id' => $row->getStoreId()]) .
'">' .
$this->escapeHtml($row->getData($this->getColumn()->getIndex())) .
- '';
+ '
' .
+ '(' . __('Code') . ': ' . $row->getStoreCode() . ')';
}
}
diff --git a/app/code/Magento/Backend/Block/System/Store/Grid/Render/Website.php b/app/code/Magento/Backend/Block/System/Store/Grid/Render/Website.php
index 913e2c903d20c..487eb4f8acfda 100644
--- a/app/code/Magento/Backend/Block/System/Store/Grid/Render/Website.php
+++ b/app/code/Magento/Backend/Block/System/Store/Grid/Render/Website.php
@@ -24,6 +24,7 @@ public function render(\Magento\Framework\DataObject $row)
$this->getUrl('adminhtml/*/editWebsite', ['website_id' => $row->getWebsiteId()]) .
'">' .
$this->escapeHtml($row->getData($this->getColumn()->getIndex())) .
- '';
+ '
' .
+ '(' . __('Code') . ': ' . $row->getCode() . ')';
}
}
diff --git a/app/code/Magento/Backend/Block/Template.php b/app/code/Magento/Backend/Block/Template.php
index d0f39b54c1492..477be0f82462b 100644
--- a/app/code/Magento/Backend/Block/Template.php
+++ b/app/code/Magento/Backend/Block/Template.php
@@ -17,10 +17,12 @@
* Example:
*
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.
- ","
- Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.
- "
+"Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.
Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer."
"Case Sensitive","Case Sensitive"
"Enable CAPTCHA on Storefront","Enable CAPTCHA on Storefront"
"CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen.","CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen."
diff --git a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml
index b8dcd6c654c8e..1be4bd19cd4ba 100644
--- a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml
+++ b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml
@@ -13,7 +13,7 @@ $captcha = $block->getCaptchaModel();
?>
+
_productFactory = $productFactory;
$this->_coreRegistry = $coreRegistry;
+ $this->visibility = $visibility ?: ObjectManager::getInstance()->get(Visibility::class);
+ $this->status = $status ?: ObjectManager::getInstance()->get(Status::class);
parent::__construct($context, $backendHelper, $data);
}
@@ -102,6 +121,10 @@ protected function _prepareCollection()
'name'
)->addAttributeToSelect(
'sku'
+ )->addAttributeToSelect(
+ 'visibility'
+ )->addAttributeToSelect(
+ 'status'
)->addAttributeToSelect(
'price'
)->joinField(
@@ -159,6 +182,28 @@ protected function _prepareColumns()
);
$this->addColumn('name', ['header' => __('Name'), 'index' => 'name']);
$this->addColumn('sku', ['header' => __('SKU'), 'index' => 'sku']);
+ $this->addColumn(
+ 'visibility',
+ [
+ 'header' => __('Visibility'),
+ 'index' => 'visibility',
+ 'type' => 'options',
+ 'options' => $this->visibility->getOptionArray(),
+ 'header_css_class' => 'col-visibility',
+ 'column_css_class' => 'col-visibility'
+ ]
+ );
+
+ $this->addColumn(
+ 'status',
+ [
+ 'header' => __('Status'),
+ 'index' => 'status',
+ 'type' => 'options',
+ 'options' => $this->status->getOptionArray()
+ ]
+ );
+
$this->addColumn(
'price',
[
diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php
index 6f8a45c6ac7ed..ed615b41644e2 100644
--- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php
+++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php
@@ -29,7 +29,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory
/**
* @var string
*/
- protected $_template = 'catalog/category/tree.phtml';
+ protected $_template = 'Magento_Catalog::catalog/category/tree.phtml';
/**
* @var \Magento\Backend\Model\Auth\Session
@@ -228,7 +228,7 @@ public function getStoreSwitcherHtml()
public function getLoadTreeUrl($expanded = null)
{
$params = ['_current' => true, 'id' => null, 'store' => null];
- if (is_null($expanded) && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
+ if ($expanded === null && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
$params['expand_all'] = true;
}
return $this->getUrl('*/*/categoriesJson', $params);
@@ -325,7 +325,7 @@ public function getBreadcrumbsJavascript($path, $javascriptVarName)
*
* @param Node|array $node
* @param int $level
- * @return string
+ * @return array
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php
index 5e98313f95f0f..9c83d4aea61c7 100644
--- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php
+++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php
@@ -24,7 +24,7 @@ class Chooser extends \Magento\Catalog\Block\Adminhtml\Category\Tree
*
* @var string
*/
- protected $_template = 'catalog/category/widget/tree.phtml';
+ protected $_template = 'Magento_Catalog::catalog/category/widget/tree.phtml';
/**
* @return void
@@ -144,7 +144,7 @@ function (node, e) {
*
* @param \Magento\Framework\Data\Tree\Node|array $node
* @param int $level
- * @return string
+ * @return array
*/
protected function _getNodeJson($node, $level = 0)
{
diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Config/YearRange.php b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Config/YearRange.php
index 0026e52e039ef..cd6c5021f0cc9 100644
--- a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Config/YearRange.php
+++ b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Config/YearRange.php
@@ -32,10 +32,9 @@ protected function _getElementHtml(AbstractElement $element)
$from = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
$to = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
- return __(
- '
' . __('Alert Stock') . '
' .
+ $this->layoutFactory->create()->createBlock(
+ Stock::class
+ )->toHtml(),
+ ]
+ ]
+ ]
+ ];
+ }
+
+ /**
+ * Prepares config for the alert price products fieldset
+ * @return array
+ */
+ private function getAlertPriceFieldset()
+ {
+ return [
+ 'arguments' => [
+ 'data' => [
+ 'config' => [
+ 'label' => __('Alert price'),
+ 'componentType' => 'container',
+ 'component' => 'Magento_Ui/js/form/components/html',
+ 'additionalClasses' => 'admin__fieldset-note',
+ 'content' =>
+ '' . __('Alert Price') . '
' .
+ $this->layoutFactory->create()->createBlock(
+ Price::class
+ )->toHtml(),
+ ]
+ ]
+ ]
+ ];
+ }
+}
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AttributeSet.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AttributeSet.php
index a1aacc91f2e47..0733d21bf47d7 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AttributeSet.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AttributeSet.php
@@ -108,6 +108,7 @@ public function modifyMeta(array $meta)
self::ATTRIBUTE_SET_FIELD_ORDER
),
'multiple' => false,
+ 'disabled' => $this->locator->getProduct()->isLockedAttribute('attribute_set_id'),
];
}
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Attributes.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Attributes.php
index aec6549f400fc..683a96133ad30 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Attributes.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Attributes.php
@@ -182,6 +182,11 @@ private function customizeAddAttributeModal(array $meta)
. '.create_new_attribute_modal',
'actionName' => 'toggleModal',
],
+ [
+ 'targetName' => 'product_form.product_form.add_attribute_modal'
+ . '.create_new_attribute_modal.product_attribute_add_form',
+ 'actionName' => 'destroyInserted'
+ ],
[
'targetName'
=> 'product_form.product_form.add_attribute_modal'
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
index 7456c1bfef91f..2dad7e8495b11 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
@@ -228,6 +228,7 @@ protected function customizeCategoriesField(array $meta)
'componentType' => 'container',
'component' => 'Magento_Ui/js/form/components/group',
'scopeLabel' => __('[GLOBAL]'),
+ 'disabled' => $this->locator->getProduct()->isLockedAttribute($fieldCode),
],
],
],
@@ -288,6 +289,7 @@ protected function customizeCategoriesField(array $meta)
'source' => 'product_details',
'displayArea' => 'insideGroup',
'sortOrder' => 20,
+ 'dataScope' => $fieldCode,
],
],
]
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php
index 73fecd17c69ce..e557c8a377681 100755
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php
@@ -348,7 +348,8 @@ protected function getHeaderContainerConfig($sortOrder)
'sortOrder' => 20,
'actions' => [
[
- 'targetName' => 'ns = ${ $.ns }, index = ' . static::GRID_OPTIONS_NAME,
+ 'targetName' => '${ $.ns }.${ $.ns }.' . static::GROUP_CUSTOM_OPTIONS_NAME
+ . '.' . static::GRID_OPTIONS_NAME,
'actionName' => 'processingAddChild',
]
]
@@ -922,7 +923,7 @@ protected function getPriceFieldConfig($sortOrder)
'addbeforePool' => $this->productOptionsPrice->prefixesToOptionArray(),
'sortOrder' => $sortOrder,
'validation' => [
- 'validate-zero-or-greater' => true
+ 'validate-number' => true
],
],
],
@@ -1045,6 +1046,7 @@ protected function getFileExtensionFieldConfig($sortOrder)
'data' => [
'config' => [
'label' => __('Compatible File Extensions'),
+ 'notice' => __('Enter separated extensions, like: png, jpg, gif.'),
'componentType' => Field::NAME,
'formElement' => Input::NAME,
'dataScope' => static::FIELD_FILE_EXTENSION_NAME,
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
index 970d485267ca0..c56d3d2d7d354 100755
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
@@ -31,6 +31,7 @@
use Magento\Ui\Component\Form\Fieldset;
use Magento\Ui\DataProvider\Mapper\FormElement as FormElementMapper;
use Magento\Ui\DataProvider\Mapper\MetaProperties as MetaPropertiesMapper;
+use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory;
/**
* Class Eav
@@ -39,6 +40,7 @@
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
* @since 101.0.0
*/
class Eav extends AbstractModifier
@@ -187,6 +189,17 @@ class Eav extends AbstractModifier
*/
private $localeCurrency;
+ /**
+ * internal cache for attribute models
+ * @var array
+ */
+ private $attributesCache = [];
+
+ /**
+ * @var AttributeCollectionFactory
+ */
+ private $attributeCollectionFactory;
+
/**
* @param LocatorInterface $locator
* @param CatalogEavValidationRules $catalogEavValidationRules
@@ -207,6 +220,7 @@ class Eav extends AbstractModifier
* @param DataPersistorInterface $dataPersistor
* @param array $attributesToDisable
* @param array $attributesToEliminate
+ * @param AttributeCollectionFactory $attributeCollectionFactory
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -228,7 +242,8 @@ public function __construct(
ScopeOverriddenValue $scopeOverriddenValue,
DataPersistorInterface $dataPersistor,
$attributesToDisable = [],
- $attributesToEliminate = []
+ $attributesToEliminate = [],
+ AttributeCollectionFactory $attributeCollectionFactory = null
) {
$this->locator = $locator;
$this->catalogEavValidationRules = $catalogEavValidationRules;
@@ -249,6 +264,8 @@ public function __construct(
$this->dataPersistor = $dataPersistor;
$this->attributesToDisable = $attributesToDisable;
$this->attributesToEliminate = $attributesToEliminate;
+ $this->attributeCollectionFactory = $attributeCollectionFactory
+ ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeCollectionFactory::class);
}
/**
@@ -265,7 +282,7 @@ public function modifyMeta(array $meta)
if ($attributes) {
$meta[$groupCode]['children'] = $this->getAttributesMeta($attributes, $groupCode);
$meta[$groupCode]['arguments']['data']['config']['componentType'] = Fieldset::NAME;
- $meta[$groupCode]['arguments']['data']['config']['label'] = __('%1', $group->getAttributeGroupName());
+ $meta[$groupCode]['arguments']['data']['config']['label'] = __($group->getAttributeGroupName());
$meta[$groupCode]['arguments']['data']['config']['collapsible'] = true;
$meta[$groupCode]['arguments']['data']['config']['dataScope'] = self::DATA_SCOPE_PRODUCT;
$meta[$groupCode]['arguments']['data']['config']['sortOrder'] =
@@ -485,39 +502,59 @@ private function getAttributeSetId()
private function getAttributes()
{
if (!$this->attributes) {
- foreach ($this->getGroups() as $group) {
- $this->attributes[$this->calculateGroupCode($group)] = $this->loadAttributes($group);
- }
+ $this->attributes = $this->loadAttributesForGroups($this->getGroups());
}
return $this->attributes;
}
/**
- * Loading product attributes from group
+ * Loads attributes for specified groups at once
*
- * @param AttributeGroupInterface $group
- * @return ProductAttributeInterface[]
+ * @param AttributeGroupInterface[] ...$groups
+ * @return @return ProductAttributeInterface[]
*/
- private function loadAttributes(AttributeGroupInterface $group)
+ private function loadAttributesForGroups(array $groups)
{
$attributes = [];
+ $groupIds = [];
+
+ foreach ($groups as $group) {
+ $groupIds[$group->getAttributeGroupId()] = $this->calculateGroupCode($group);
+ $attributes[$this->calculateGroupCode($group)] = [];
+ }
+
+ $collection = $this->attributeCollectionFactory->create();
+ $collection->setAttributeGroupFilter(array_keys($groupIds));
+
+ $mapAttributeToGroup = [];
+
+ foreach ($collection->getItems() as $attribute) {
+ $mapAttributeToGroup[$attribute->getAttributeId()] = $attribute->getAttributeGroupId();
+ }
+
$sortOrder = $this->sortOrderBuilder
->setField('sort_order')
->setAscendingDirection()
->create();
+
$searchCriteria = $this->searchCriteriaBuilder
- ->addFilter(AttributeGroupInterface::GROUP_ID, $group->getAttributeGroupId())
+ ->addFilter(AttributeGroupInterface::GROUP_ID, array_keys($groupIds), 'in')
->addFilter(ProductAttributeInterface::IS_VISIBLE, 1)
->addSortOrder($sortOrder)
->create();
+
$groupAttributes = $this->attributeRepository->getList($searchCriteria)->getItems();
+
$productType = $this->getProductType();
+
foreach ($groupAttributes as $attribute) {
$applyTo = $attribute->getApplyTo();
$isRelated = !$applyTo || in_array($productType, $applyTo);
if ($isRelated) {
- $attributes[] = $attribute;
+ $attributeGroupId = $mapAttributeToGroup[$attribute->getAttributeId()];
+ $attributeGroupCode = $groupIds[$attributeGroupId];
+ $attributes[$attributeGroupCode][] = $attribute;
}
}
@@ -553,7 +590,7 @@ private function getPreviousSetAttributes()
*/
private function isProductExists()
{
- return (bool) $this->locator->getProduct()->getId();
+ return (bool)$this->locator->getProduct()->getId();
}
/**
@@ -572,7 +609,7 @@ private function isProductExists()
public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupCode, $sortOrder)
{
$configPath = ltrim(static::META_CONFIG_PATH, ArrayManager::DEFAULT_PATH_DELIMITER);
-
+ $attributeCode = $attribute->getAttributeCode();
$meta = $this->arrayManager->set($configPath, [], [
'dataType' => $attribute->getFrontendInput(),
'formElement' => $this->getFormElementsMapValue($attribute->getFrontendInput()),
@@ -581,7 +618,7 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC
'notice' => $attribute->getNote(),
'default' => (!$this->isProductExists()) ? $attribute->getDefaultValue() : null,
'label' => $attribute->getDefaultFrontendLabel(),
- 'code' => $attribute->getAttributeCode(),
+ 'code' => $attributeCode,
'source' => $groupCode,
'scopeLabel' => $this->getScopeLabel($attribute),
'globalScope' => $this->isScopeGlobal($attribute),
@@ -591,8 +628,9 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC
// TODO: Refactor to $attribute->getOptions() when MAGETWO-48289 is done
$attributeModel = $this->getAttributeModel($attribute);
if ($attributeModel->usesSource()) {
+ $options = $attributeModel->getSource()->getAllOptions();
$meta = $this->arrayManager->merge($configPath, $meta, [
- 'options' => $attributeModel->getSource()->getAllOptions(),
+ 'options' => $this->convertOptionsValueToString($options),
]);
}
@@ -610,7 +648,8 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC
]);
}
- if (in_array($attribute->getAttributeCode(), $this->attributesToDisable)) {
+ $product = $this->locator->getProduct();
+ if (in_array($attributeCode, $this->attributesToDisable) || $product->isLockedAttribute($attributeCode)) {
$meta = $this->arrayManager->merge($configPath, $meta, [
'disabled' => true,
]);
@@ -645,6 +684,22 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC
return $meta;
}
+ /**
+ * Convert options value to string
+ *
+ * @param array $options
+ * @return array
+ */
+ private function convertOptionsValueToString(array $options): array
+ {
+ array_walk($options, function (&$value) {
+ if (isset($value['value']) && is_scalar($value['value'])) {
+ $value['value'] = (string)$value['value'];
+ }
+ });
+ return $options;
+ }
+
/**
* @param ProductAttributeInterface $attribute
* @param array $meta
@@ -800,7 +855,7 @@ private function getFormElementsMapValue($value)
{
$valueMap = $this->formElementMapper->getMappings();
- return isset($valueMap[$value]) ? $valueMap[$value] : $value;
+ return $valueMap[$value] ?? $value;
}
/**
@@ -854,6 +909,9 @@ private function canDisplayUseDefault(ProductAttributeInterface $attribute)
$attributeCode = $attribute->getAttributeCode();
/** @var Product $product */
$product = $this->locator->getProduct();
+ if ($product->isLockedAttribute($attributeCode)) {
+ return false;
+ }
if (isset($this->canDisplayUseDefault[$attributeCode])) {
return $this->canDisplayUseDefault[$attributeCode];
@@ -888,7 +946,13 @@ private function isScopeGlobal($attribute)
*/
private function getAttributeModel($attribute)
{
- return $this->eavAttributeFactory->create()->load($attribute->getAttributeId());
+ $attributeId = $attribute->getAttributeId();
+
+ if (!array_key_exists($attributeId, $this->attributesCache)) {
+ $this->attributesCache[$attributeId] = $this->eavAttributeFactory->create()->load($attributeId);
+ }
+
+ return $this->attributesCache[$attributeId];
}
/**
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php
index ea69ebf4dda24..ec3ef58ded569 100755
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php
@@ -7,6 +7,7 @@
use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Catalog\Model\Locator\LocatorInterface;
+use Magento\Eav\Api\AttributeRepositoryInterface;
use Magento\Ui\Component\Form;
use Magento\Framework\Stdlib\ArrayManager;
@@ -35,16 +36,25 @@ class General extends AbstractModifier
*/
private $localeCurrency;
+ /**
+ * @var AttributeRepositoryInterface
+ */
+ private $attributeRepository;
+
/**
* @param LocatorInterface $locator
* @param ArrayManager $arrayManager
+ * @param AttributeRepositoryInterface|null $attributeRepository
*/
public function __construct(
LocatorInterface $locator,
- ArrayManager $arrayManager
+ ArrayManager $arrayManager,
+ AttributeRepositoryInterface $attributeRepository = null
) {
$this->locator = $locator;
$this->arrayManager = $arrayManager;
+ $this->attributeRepository = $attributeRepository
+ ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeRepositoryInterface::class);
}
/**
@@ -58,7 +68,12 @@ public function modifyData(array $data)
$modelId = $this->locator->getProduct()->getId();
if (!isset($data[$modelId][static::DATA_SOURCE_DEFAULT][ProductAttributeInterface::CODE_STATUS])) {
- $data[$modelId][static::DATA_SOURCE_DEFAULT][ProductAttributeInterface::CODE_STATUS] = '1';
+ $attributeStatus = $this->attributeRepository->get(
+ ProductAttributeInterface::ENTITY_TYPE_CODE,
+ ProductAttributeInterface::CODE_STATUS
+ );
+ $data[$modelId][static::DATA_SOURCE_DEFAULT][ProductAttributeInterface::CODE_STATUS] =
+ $attributeStatus->getDefaultValue() ?: 1;
}
return $data;
@@ -106,7 +121,7 @@ protected function customizeAdvancedPriceFormat(array $data)
$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE] =
$this->formatPrice($value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE]);
$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY] =
- (int)$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY];
+ (float) $value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY];
}
}
@@ -187,7 +202,7 @@ protected function customizeStatusField(array $meta)
protected function customizeWeightField(array $meta)
{
$weightPath = $this->arrayManager->findPath(ProductAttributeInterface::CODE_WEIGHT, $meta, null, 'children');
-
+ $disabled = $this->arrayManager->get($weightPath . '/arguments/data/config/disabled', $meta);
if ($weightPath) {
$meta = $this->arrayManager->merge(
$weightPath . static::META_CONFIG_PATH,
@@ -199,7 +214,7 @@ protected function customizeWeightField(array $meta)
],
'additionalClasses' => 'admin__field-small',
'addafter' => $this->locator->getStore()->getConfig('general/locale/weight_unit'),
- 'imports' => [
+ 'imports' => $disabled ? [] : [
'disabled' => '!${$.provider}:' . self::DATA_SCOPE_PRODUCT
. '.product_has_weight:value'
]
@@ -239,6 +254,7 @@ protected function customizeWeightField(array $meta)
],
],
'value' => (int)$this->locator->getProduct()->getTypeInstance()->hasWeight(),
+ 'disabled' => $disabled,
]
);
}
@@ -264,23 +280,36 @@ protected function customizeNewDateRangeField(array $meta)
if ($fromFieldPath && $toFieldPath) {
$fromContainerPath = $this->arrayManager->slicePath($fromFieldPath, 0, -2);
$toContainerPath = $this->arrayManager->slicePath($toFieldPath, 0, -2);
+ $commonFieldsMeta = [
+ 'outputDateTimeToISO' => false,
+ 'inputDateTimeFormat' => 'YYYY-MM-DD h:mm',
+ 'options' => [
+ 'showsTime' => true,
+ ]
+ ];
$meta = $this->arrayManager->merge(
$fromFieldPath . self::META_CONFIG_PATH,
$meta,
- [
- 'label' => __('Set Product as New From'),
- 'additionalClasses' => 'admin__field-date',
- ]
+ array_merge(
+ [
+ 'label' => __('Set Product as New From'),
+ 'additionalClasses' => 'admin__field-date',
+ ],
+ $commonFieldsMeta
+ )
);
$meta = $this->arrayManager->merge(
$toFieldPath . self::META_CONFIG_PATH,
$meta,
- [
- 'label' => __('To'),
- 'scopeLabel' => null,
- 'additionalClasses' => 'admin__field-date',
- ]
+ array_merge(
+ [
+ 'label' => __('To'),
+ 'scopeLabel' => null,
+ 'additionalClasses' => 'admin__field-date',
+ ],
+ $commonFieldsMeta
+ )
);
$meta = $this->arrayManager->merge(
$fromContainerPath . self::META_CONFIG_PATH,
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php
index 298da3d5cd6f2..8166c42a5a8b1 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php
@@ -135,7 +135,6 @@ public function modifyMeta(array $meta)
'collapsible' => true,
'componentType' => Form\Fieldset::NAME,
'dataScope' => self::DATA_SCOPE_PRODUCT,
- 'disabled' => false,
'sortOrder' => $this->getNextGroupSortOrder(
$meta,
'search-engine-optimization',
@@ -176,9 +175,11 @@ protected function getFieldsForFieldset()
$label = __('Websites');
$defaultWebsiteId = $this->websiteRepository->getDefault()->getId();
+ $isOnlyOneWebsiteAvailable = count($websitesList) === 1;
foreach ($websitesList as $website) {
$isChecked = in_array($website['id'], $websiteIds)
- || ($defaultWebsiteId == $website['id'] && $isNewProduct);
+ || ($defaultWebsiteId == $website['id'] && $isNewProduct)
+ || $isOnlyOneWebsiteAvailable;
$children[$website['id']] = [
'arguments' => [
'data' => [
@@ -196,6 +197,7 @@ protected function getFieldsForFieldset()
'false' => '0',
],
'value' => $isChecked ? (string)$website['id'] : '0',
+ 'disabled' => $this->locator->getProduct()->isLockedAttribute('website_ids'),
],
],
],
@@ -397,8 +399,9 @@ protected function getWebsitesList()
$this->websitesList = [];
$groupList = $this->groupRepository->getList();
$storesList = $this->storeRepository->getList();
+ $websiteList = $this->storeManager->getWebsites(true);
- foreach ($this->websiteRepository->getList() as $website) {
+ foreach ($websiteList as $website) {
$websiteId = $website->getId();
if (!$websiteId) {
continue;
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php
index 2fc9ef76aa00d..216bc16968fcb 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Image.php
@@ -11,6 +11,7 @@
use Magento\Catalog\Api\Data\ProductRender\ImageInterfaceFactory;
use Magento\Catalog\Api\Data\ProductRenderInterface;
use Magento\Catalog\Helper\ImageFactory;
+use Magento\Catalog\Model\Product\Image\NotLoadInfoImageException;
use Magento\Catalog\Ui\DataProvider\Product\ProductRenderCollectorInterface;
use Magento\Framework\App\State;
use Magento\Framework\View\DesignInterface;
@@ -102,7 +103,12 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ
[$this, "emulateImageCreating"],
[$product, $imageCode, (int) $productRender->getStoreId(), $image]
);
- $resizedInfo = $helper->getResizedImageInfo();
+
+ try {
+ $resizedInfo = $helper->getResizedImageInfo();
+ } catch (NotLoadInfoImageException $exception) {
+ $resizedInfo = [$helper->getWidth(), $helper->getHeight()];
+ }
$image->setCode($imageCode);
$image->setHeight($helper->getHeight());
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php
new file mode 100644
index 0000000000000..f4334bc25efd8
--- /dev/null
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php
@@ -0,0 +1,28 @@
+_productLimitationFilters->setUsePriceIndex(false);
+ return $this->_productLimitationPrice(true);
+ }
+}
diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php
new file mode 100644
index 0000000000000..e897c330b7e0f
--- /dev/null
+++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php
@@ -0,0 +1,115 @@
+catalogData = $catalogData;
+ $this->scopeConfig = $scopeConfig;
+ $this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
+ $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
+ }
+
+ /**
+ * Returns category URL suffix.
+ *
+ * @return mixed
+ */
+ public function getCategoryUrlSuffix()
+ {
+ return $this->scopeConfig->getValue(
+ 'catalog/seo/category_url_suffix',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ );
+ }
+
+ /**
+ * Checks if categories path is used for product URLs.
+ *
+ * @return bool
+ */
+ public function isCategoryUsedInProductUrl()
+ {
+ return $this->scopeConfig->isSetFlag(
+ 'catalog/seo/product_use_categories',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ );
+ }
+
+ /**
+ * Returns product name.
+ *
+ * @return string
+ */
+ public function getProductName()
+ {
+ return $this->catalogData->getProduct() !== null
+ ? $this->catalogData->getProduct()->getName()
+ : '';
+ }
+
+ /**
+ * Returns breadcrumb json.
+ *
+ * @return string
+ */
+ public function getJsonConfiguration()
+ {
+ return $this->escaper->escapeHtml($this->json->serialize([
+ 'breadcrumbs' => [
+ 'categoryUrlSuffix' => $this->escaper->escapeHtml($this->getCategoryUrlSuffix()),
+ 'userCategoryPathInUrl' => (int)$this->isCategoryUsedInProductUrl(),
+ 'product' => $this->getProductName()
+ ]
+ ]));
+ }
+}
diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json
index 391d6065fd867..4535e527d2dec 100644
--- a/app/code/Magento/Catalog/composer.json
+++ b/app/code/Magento/Catalog/composer.json
@@ -2,39 +2,39 @@
"name": "magento/module-catalog",
"description": "N/A",
"require": {
- "php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
+ "php": "~7.0.13|~7.1.0",
"magento/module-store": "100.2.*",
- "magento/module-eav": "100.2.*",
- "magento/module-cms": "101.1.*",
+ "magento/module-eav": "101.0.*",
+ "magento/module-cms": "102.0.*",
"magento/module-indexer": "100.2.*",
- "magento/module-customer": "100.2.*",
+ "magento/module-customer": "101.0.*",
"magento/module-theme": "100.2.*",
"magento/module-checkout": "100.2.*",
"magento/module-backend": "100.2.*",
- "magento/module-widget": "100.2.*",
- "magento/module-wishlist": "100.2.*",
+ "magento/module-widget": "101.0.*",
+ "magento/module-wishlist": "101.0.*",
"magento/module-tax": "100.2.*",
"magento/module-msrp": "100.2.*",
"magento/module-catalog-inventory": "100.2.*",
"magento/module-directory": "100.2.*",
- "magento/module-catalog-rule": "100.2.*",
+ "magento/module-catalog-rule": "101.0.*",
"magento/module-product-alert": "100.2.*",
- "magento/module-url-rewrite": "100.2.*",
+ "magento/module-url-rewrite": "101.0.*",
"magento/module-catalog-url-rewrite": "100.2.*",
"magento/module-page-cache": "100.2.*",
- "magento/module-quote": "100.2.*",
- "magento/module-config": "100.2.*",
+ "magento/module-quote": "101.0.*",
+ "magento/module-config": "101.0.*",
"magento/module-media-storage": "100.2.*",
- "magento/framework": "100.2.*",
- "magento/module-ui": "100.2.*"
+ "magento/framework": "101.0.*",
+ "magento/module-ui": "101.0.*"
},
"suggest": {
"magento/module-cookie": "100.2.*",
- "magento/module-sales": "100.2.*",
+ "magento/module-sales": "101.0.*",
"magento/module-catalog-sample-data": "Sample Data version:100.2.*"
},
"type": "magento2-module",
- "version": "101.1.0-dev",
+ "version": "102.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml
index 790bd163a6f17..9739ee28a6dae 100644
--- a/app/code/Magento/Catalog/etc/adminhtml/di.xml
+++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml
@@ -78,6 +78,11 @@
<% _.each(data.items, function(value) { %>
-
<% if (!data.term && data.items.length && !data.allShown()) { %>
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml
index 693c98fc02cab..9f0fc0c569d6c 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml
@@ -41,6 +41,7 @@
+
x %2 px.',
'',
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/tab/inventory.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/tab/inventory.phtml
index 15c33c56e3ac6..2c62bbf8db3e9 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/tab/inventory.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/tab/inventory.phtml
@@ -27,7 +27,7 @@
- getFieldValue('use_config_manage_stock') || $block->IsNew()) ? 'checked="checked"' : '' ?>
+ getFieldValue('use_config_manage_stock') || $block->isNew()) ? 'checked="checked"' : '' ?>
onclick="toggleValueElements(this, this.parentNode);" = /* @escapeNotVerified */ $_readonly ?>>