Skip to content

Commit

Permalink
Merge branch '2.3-develop' into forwardport-2.3-develop-magento-magen…
Browse files Browse the repository at this point in the history
…to2-12141

# Conflicts:
#	app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js
  • Loading branch information
magento-engcom-team committed Feb 1, 2018
2 parents e9238bc + 3881f04 commit 4e00485
Show file tree
Hide file tree
Showing 511 changed files with 9,680 additions and 9,906 deletions.
3 changes: 2 additions & 1 deletion .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
############################################
## enable rewrites

Options +FollowSymLinks
# The following line has better security but add some performance overhead - see https://httpd.apache.org/docs/2.4/en/misc/perf-tuning.html
Options -FollowSymLinks +SymLinksIfOwnerMatch
RewriteEngine on

############################################
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.

## Magento system requirements
[Magento system requirements](http://devdocs.magento.com/magento-system-requirements.html)
[Magento system requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html)

## Install Magento
To install Magento, see either:

* [Magento DevBox](https://magento.com/tech-resources/download), the easiest way to get started with Magento.
* [Installation guide](http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html)
* [Installation guide](http://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html)

<h2>Contributing to the Magento 2 code base</h2>
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, optimizations, or just good suggestions.
Expand All @@ -22,8 +22,8 @@ To learn about issues, click [here][2]. To open an issue, click [here][3].

To suggest documentation improvements, click [here][4].

[1]: <http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html>
[2]: <http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#report>
[1]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html>
[2]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#report>
[3]: <https://github.com/magento/magento2/issues>
[4]: <http://devdocs.magento.com>

Expand Down
4 changes: 2 additions & 2 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
if (PHP_SAPI == 'cli') {
echo 'Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. ' .
'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
'Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html';
} else {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<p>Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read
<a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
<a target="_blank" href="http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html">
Magento System Requirements</a>.
</div>
HTML;
Expand Down
3 changes: 0 additions & 3 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ public function getFeedData()
);
$curl->write(\Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
$data = $curl->read();
if ($data === false) {
return false;
}
$data = preg_split('/^\r?$/m', $data, 2);
$data = trim($data[1]);
$curl->close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ protected function saveAndReplaceAdvancedPrices()
? $rowData[self::COL_TIER_PRICE] : 0,
'percentage_value' => $rowData[self::COL_TIER_PRICE_TYPE] === self::TIER_PRICE_TYPE_PERCENT
? $rowData[self::COL_TIER_PRICE] : null,
'website_id' => $this->getWebsiteId($rowData[self::COL_TIER_PRICE_WEBSITE])
'website_id' => $this->getWebSiteId($rowData[self::COL_TIER_PRICE_WEBSITE])
];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WebsiteTest extends \PHPUnit\Framework\TestCase

protected function setUp()
{
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\WebSite::class)
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\Website::class)
->setMethods(['getBaseCurrency'])
->disableOriginalConstructor()
->getMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function _prepareForm()
['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]
);

$this->_prepareStoreFieldSet($form);
$this->_prepareStoreFieldset($form);

$form->addField(
'store_type',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setStatusHeader(404, '1.1', 'Forbidden');
$resultPage->setStatusHeader(404, '1.1', 'Not Found');
$resultPage->setHeader('Status', '404 File not found');
$resultPage->addHandle('adminhtml_noroute');
return $resultPage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public function execute()
$user = $this->_objectManager->create(\Magento\User\Model\User::class)->load($userId);

$user->setId($userId)
->setUsername($this->getRequest()->getParam('username', false))
->setFirstname($this->getRequest()->getParam('firstname', false))
->setLastname($this->getRequest()->getParam('lastname', false))
->setUserName($this->getRequest()->getParam('username', false))
->setFirstName($this->getRequest()->getParam('firstname', false))
->setLastName($this->getRequest()->getParam('lastname', false))
->setEmail(strtolower($this->getRequest()->getParam('email', false)));

if ($this->_objectManager->get(\Magento\Framework\Validator\Locale::class)->isValid($interfaceLocale)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function testSetFilterTypePropagatesFilterTypeToColumns()

public function testGetRowUrlIfUrlPathNotSet()
{
$this->assertEquals('#', $this->_block->getRowUrl(new \StdClass()));
$this->assertEquals('#', $this->_block->getRowUrl(new \stdClass()));
}

public function testGetRowUrl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function testSetGetGrid()

$this->_block->setFilter('StdClass');

$grid = new \StdClass();
$grid = new \stdClass();
$this->_block->setGrid($grid);
$this->assertEquals($grid, $this->_block->getGrid());
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
<label>European Union Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
</field>
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Top destinations</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
data-mage-init='{"dropdown":{}}'
data-toggle="dropdown">
<span class="admin__action-dropdown-text">
<span class="admin-user-account-text"><?= $block->escapeHtml($block->getUser()->getUsername()) ?></span>
<span class="admin-user-account-text"><?= $block->escapeHtml($block->getUser()->getUserName()) ?></span>
</span>
</a>
<ul class="admin__action-dropdown-menu">
Expand All @@ -39,7 +39,7 @@
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/system_account/index') ?>"
<?= /* @escapeNotVerified */ $block->getUiId('user', 'account', 'settings') ?>
title="<?= $block->escapeHtml(__('Account Setting')) ?>">
<?= /* @escapeNotVerified */ __('Account Setting') ?> (<span class="admin-user-name"><?= $block->escapeHtml($block->getUser()->getUsername()) ?></span>)
<?= /* @escapeNotVerified */ __('Account Setting') ?> (<span class="admin-user-name"><?= $block->escapeHtml($block->getUser()->getUserName()) ?></span>)
</a>
</li>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
<script data-template="search-suggest" type="text/x-magento-template">
<ul class="search-global-menu">
<li class="item">
<a id="searchPreviewProducts" href="<?= /* @escapeNotVerified */ $block->getURL('catalog/product/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Products</a>
<a id="searchPreviewProducts" href="<?= /* @escapeNotVerified */ $block->getUrl('catalog/product/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Products</a>
</li>
<li class="item">
<a id="searchPreviewOrders" href="<?= /* @escapeNotVerified */ $block->getURL('sales/order/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Orders</a>
<a id="searchPreviewOrders" href="<?= /* @escapeNotVerified */ $block->getUrl('sales/order/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Orders</a>
</li>
<li class="item">
<a id="searchPreviewCustomers" href="<?= /* @escapeNotVerified */ $block->getURL('customer/index/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Customers</a>
<a id="searchPreviewCustomers" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/index/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Customers</a>
</li>
<li class="item">
<a id="searchPreviewPages" href="<?= /* @escapeNotVerified */ $block->getURL('cms/page/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Pages</a>
<a id="searchPreviewPages" href="<?= /* @escapeNotVerified */ $block->getUrl('cms/page/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Pages</a>
</li>
<% if (data.items.length) { %>
<% _.each(data.items, function(value){ %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $numColumns = sizeof($block->getColumns());
<?php if ($block->getPagerVisibility()): ?>
<div class="admin__data-grid-pager-wrap">
<select name="<?= /* @escapeNotVerified */ $block->getVarNameLimit() ?>"
id="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-limit"
id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
onchange="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.loadByElement(this)"
class="admin__control-select">
<option value="20"<?php if ($block->getCollection()->getPageSize() == 20): ?>
Expand All @@ -91,7 +91,7 @@ $numColumns = sizeof($block->getColumns());
selected="selected"<?php endif; ?>>200
</option>
</select>
<label for="<?= $block->escapeHTML($block->getHtmlId()) ?><?= $block->escapeHTML($block->getHtmlId()) ?>_page-limit"
<label for="<?= $block->escapeHtml($block->getHtmlId()) ?><?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
class="admin__control-support-text"><?= /* @escapeNotVerified */ __('per page') ?></label>

<div class="admin__data-grid-pager">
Expand All @@ -107,12 +107,12 @@ $numColumns = sizeof($block->getColumns());
<button type="button" class="action-previous disabled"><span><?= /* @escapeNotVerified */ __('Previous page') ?></span></button>
<?php endif; ?>
<input type="text"
id="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-current"
id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current"
name="<?= /* @escapeNotVerified */ $block->getVarNamePage() ?>"
value="<?= /* @escapeNotVerified */ $_curPage ?>"
class="admin__control-text"
onkeypress="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.inputPage(event, '<?= /* @escapeNotVerified */ $_lastPage ?>')" <?= /* @escapeNotVerified */ $block->getUiId('current-page') ?> />
<label class="admin__control-support-text" for="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-current">
<label class="admin__control-support-text" for="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current">
<?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
</label>
<?php if ($_curPage < $_lastPage): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="messages">
<div class="message message-notice notice">
<span
translate="'Search strings are either normal strings or regular exceptions (PCRE). They are matched in the same order as entered.'"></span>
translate="'Search strings are either normal strings or regular expressions (PCRE). They are matched in the same order as entered.'"></span>
<br>
<span
translate="'Examples'"></span>:
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/Model/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu

if ($tableStatus->getDataLength() > self::BUFFER_LENGTH) {
if ($tableStatus->getAvgRowLength() < self::BUFFER_LENGTH) {
$limit = floor(self::BUFFER_LENGTH / $tableStatus->getAvgRowLength());
$limit = floor(self::BUFFER_LENGTH / max($tableStatus->getAvgRowLength(), 1));
$multiRowsLength = ceil($tableStatus->getRows() / $limit);
} else {
$limit = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ define(
*/
onError: function (response) {
braintree.showError($t('Payment ' + this.getTitle() + ' can\'t be initialized'));
this.isPlaceOrderActionAllowed(true);
throw response.message;
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function getValuesHtml()
]
);
if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN) {
$select->setName('options[' . $_option->getid() . ']')->addOption('', __('-- Please Select --'));
$select->setName('options[' . $_option->getId() . ']')->addOption('', __('-- Please Select --'));
} else {
$select->setName('options[' . $_option->getid() . '][]');
$select->setName('options[' . $_option->getId() . '][]');
$select->setClass('multiselect admin__control-multiselect' . $require . ' product-custom-option');
}
foreach ($_option->getValues() as $_value) {
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Helper/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,18 @@ public function initProductLayout(ResultPage $resultPage, $product, $params = nu
// Load default page handles and page configurations
if ($params && $params->getBeforeHandles()) {
foreach ($params->getBeforeHandles() as $handle) {
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], $handle, false);
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
}
}

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

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

if ($params && $params->getAfterHandles()) {
foreach ($params->getAfterHandles() as $handle) {
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], $handle, false);
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
}
}

Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Catalog/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,14 @@ public function getAllChildren($asArray = false)
/**
* Retrieve children ids comma separated
*
* @param boolean $recursive
* @param boolean $isActive
* @param boolean $sortByPosition
* @return string
*/
public function getChildren()
public function getChildren($recursive = false, $isActive = true, $sortByPosition = false)
{
return implode(',', $this->getResource()->getChildren($this, false));
return implode(',', $this->getResource()->getChildren($this, $recursive, $isActive, $sortByPosition));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ private function mergeCategoryLinks($newCategoryPositions, $oldCategoryPositions

if ($key === false) {
$result[] = $newCategoryPosition;
} elseif ($oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']) {
} elseif (isset($oldCategoryPositions[$key])
&& $oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']
) {
$result[] = $newCategoryPositions[$key];
unset($oldCategoryPositions[$key]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public function getItems($attributeCode)
*/
public function add($attributeCode, $option)
{
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface[] $currentOptions */
$currentOptions = $this->getItems($attributeCode);
if (is_array($currentOptions)) {
array_walk($currentOptions, function (&$attributeOption) {
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface $attributeOption */
$attributeOption = $attributeOption->getLabel();
});
if (in_array($option->getLabel(), $currentOptions)) {
return false;
}
}
return $this->eavOptionManagement->add(
\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE,
$attributeCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function addImage(
}

$fileName = \Magento\MediaStorage\Model\File\Uploader::getCorrectFileName($pathinfo['basename']);
$dispretionPath = \Magento\MediaStorage\Model\File\Uploader::getDispretionPath($fileName);
$dispretionPath = \Magento\MediaStorage\Model\File\Uploader::getDispersionPath($fileName);
$fileName = $dispretionPath . '/' . $fileName;

$fileName = $this->getNotDuplicatedFilename($fileName, $dispretionPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function validate($processingParams, $option)
$extension = pathinfo(strtolower($fileInfo['name']), PATHINFO_EXTENSION);

$fileName = \Magento\MediaStorage\Model\File\Uploader::getCorrectFileName($fileInfo['name']);
$dispersion = \Magento\MediaStorage\Model\File\Uploader::getDispretionPath($fileName);
$dispersion = \Magento\MediaStorage\Model\File\Uploader::getDispersionPath($fileName);

$filePath = $dispersion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,7 @@ public function getAttributeRawValue($entityId, $attribute, $store)
}

if (is_array($attributesData) && sizeof($attributesData) == 1) {
$_data = each($attributesData);
$attributesData = $_data[1];
$attributesData = array_shift($attributesData);
}

return $attributesData === false ? false : $attributesData;
Expand Down
Loading

0 comments on commit 4e00485

Please sign in to comment.