Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/2.3-develop' into add-sort-ord…
Browse files Browse the repository at this point in the history
…er-downloadable-links

# Conflicts:
#	app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php
#	app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Samples.php
  • Loading branch information
nmalevanec committed Mar 4, 2019
2 parents 03f0c3a + 9ef2d45 commit 81a4de8
Show file tree
Hide file tree
Showing 504 changed files with 16,784 additions and 8,248 deletions.
6 changes: 3 additions & 3 deletions app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@
</depends>
</field>
<!--<group id="suggestions">-->
<field id="search_suggestion_enabled" translate="label comment" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="search_suggestion_enabled" translate="label comment" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable Search Suggestions</label>
<comment>When you enable this option your site may slow down.</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="search_suggestion_count" translate="label" type="text" sortOrder="71" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="search_suggestion_count" translate="label" type="text" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Search Suggestions Count</label>
<depends>
<field id="search_suggestion_enabled">1</field>
</depends>
</field>
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="72" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show Results Count for Each Suggestion</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>When you enable this option your site may slow down.</comment>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
<methods>
<method name="authorizenet_acceptjs">
<allow_multiple_address>1</allow_multiple_address>
<allow_multiple_address>0</allow_multiple_address>
</method>
</methods>
</payment>
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
*/

var config = {
shim: {
acceptjs: {
exports: 'Accept'
},
acceptjssandbox: {
exports: 'Accept'
map: {
'*': {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
acceptjs: 'https://js.authorize.net/v1/Accept.js'
}
},
paths: {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
acceptjs: 'https://js.authorize.net/v1/Accept'
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define([
dependency = 'acceptjssandbox';
}

require([dependency], function (accept) {
require([dependency], function () {
var $body = $('body');

/*
Expand All @@ -26,7 +26,16 @@ define([
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
*/
$body.on('handshake.acceptjs', function () {
deferred.resolve(accept);
/*
* Accept.js doesn't return the library when loading
* and requirejs "shim" can't be used because it only works with the "paths" config option
* and we can't use "paths" because require will try to load ".min.js" in production
* and that doesn't work because it doesn't exist
* and we can't add a query string to force a URL because accept.js will reject it
* and we can't include it locally because they check in the script before loading more scripts
* So, we use the global version as "shim" would
*/
deferred.resolve(window.Accept);
$body.off('handshake.acceptjs');
});
},
Expand Down
9 changes: 5 additions & 4 deletions app/code/Magento/Backend/Block/Template/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @api
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Context extends \Magento\Framework\View\Element\Template\Context
Expand Down Expand Up @@ -174,7 +175,7 @@ public function getAuthorization()
}

/**
* Get Backend Session
* Get backend session instance.
*
* @return \Magento\Backend\Model\Session
*/
Expand All @@ -184,7 +185,7 @@ public function getBackendSession()
}

/**
* Get Math Random
* Get math random instance.
*
* @return \Magento\Framework\Math\Random
*/
Expand All @@ -194,7 +195,7 @@ public function getMathRandom()
}

/**
* Get Form Key
* Get form key instance.
*
* @return \Magento\Framework\Data\Form\FormKey
*/
Expand All @@ -204,7 +205,7 @@ public function getFormKey()
}

/**
* Get Class Name Builder
* Get name builder instance.
*
* @return \Magento\Framework\Code\NameBuilder
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ abstract class AbstractRenderer extends \Magento\Backend\Block\AbstractBlock imp
protected $_column;

/**
* Set column for renderer.
*
* @param Column $column
* @return $this
*/
Expand All @@ -38,6 +40,8 @@ public function setColumn($column)
}

/**
* Returns row associated with the renderer.
*
* @return Column
*/
public function getColumn()
Expand All @@ -48,7 +52,7 @@ public function getColumn()
/**
* Renders grid column
*
* @param Object $row
* @param DataObject $row
* @return string
*/
public function render(DataObject $row)
Expand All @@ -66,7 +70,7 @@ public function render(DataObject $row)
/**
* Render column for export
*
* @param Object $row
* @param DataObject $row
* @return string
*/
public function renderExport(DataObject $row)
Expand All @@ -75,7 +79,9 @@ public function renderExport(DataObject $row)
}

/**
* @param Object $row
* Returns value of the row.
*
* @param DataObject $row
* @return mixed
*/
protected function _getValue(DataObject $row)
Expand All @@ -92,7 +98,9 @@ protected function _getValue(DataObject $row)
}

/**
* @param Object $row
* Get pre-rendered input element.
*
* @param DataObject $row
* @return string
*/
public function _getInputValueElement(DataObject $row)
Expand All @@ -108,7 +116,9 @@ public function _getInputValueElement(DataObject $row)
}

/**
* @param Object $row
* Get input value by row.
*
* @param DataObject $row
* @return mixed
*/
protected function _getInputValue(DataObject $row)
Expand All @@ -117,6 +127,8 @@ protected function _getInputValue(DataObject $row)
}

/**
* Renders header of the column,
*
* @return string
*/
public function renderHeader()
Expand Down Expand Up @@ -148,6 +160,8 @@ public function renderHeader()
}

/**
* Render HTML properties.
*
* @return string
*/
public function renderProperty()
Expand All @@ -172,6 +186,8 @@ public function renderProperty()
}

/**
* Returns HTML for CSS.
*
* @return string
*/
public function renderCss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
*/
namespace Magento\Backend\Controller\Adminhtml\Dashboard;

class ProductsViewed extends AjaxBlock
use Magento\Framework\App\Action\HttpGetActionInterface;

/**
* Get most viewed products controller.
*/
class ProductsViewed extends AjaxBlock implements HttpGetActionInterface
{
/**
* Gets most viewed products list
*
* @return \Magento\Backend\Model\View\Result\Page
* @return \Magento\Framework\Controller\Result\Raw
*/
public function execute()
{
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Backend/Model/Session/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @method Quote setOrderId($orderId)
* @method int getOrderId()
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Quote extends \Magento\Framework\Session\SessionManager
Expand Down Expand Up @@ -149,7 +150,8 @@ public function getQuote()
$this->_quote = $this->quoteFactory->create();
if ($this->getStoreId()) {
if (!$this->getQuoteId()) {
$this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup()->getId());
$customerGroupId = $this->groupManagement->getDefaultGroup($this->getStoreId())->getId();
$this->_quote->setCustomerGroupId($customerGroupId);
$this->_quote->setIsActive(false);
$this->_quote->setStoreId($this->getStoreId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ public function testGetQuoteWithoutQuoteId()
$cartInterfaceMock->expects($this->atLeastOnce())->method('getId')->willReturn($quoteId);
$defaultGroup = $this->getMockBuilder(\Magento\Customer\Api\Data\GroupInterface::class)->getMock();
$defaultGroup->expects($this->any())->method('getId')->will($this->returnValue($customerGroupId));
$this->groupManagementMock->expects($this->any())->method('getDefaultGroup')->willReturn($defaultGroup);
$this->groupManagementMock
->method('getDefaultGroup')
->with($storeId)
->willReturn($defaultGroup);

$dataCustomerMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)
->disableOriginalConstructor()
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<group id="debug" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Debug</label>
<field id="template_hints_storefront" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled Template Path Hints for Storefront</label>
<label>Enable Template Path Hints for Storefront</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="template_hints_storefront_show_with_parameter" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
Expand All @@ -132,7 +132,7 @@
<comment>Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]</comment>
</field>
<field id="template_hints_admin" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enabled Template Path Hints for Admin</label>
<label>Enable Template Path Hints for Admin</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="template_hints_blocks" translate="label" type="select" sortOrder="21" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/Backup/Controller/Adminhtml/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
namespace Magento\Backup\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Backup\Helper\Data as Helper;
use Magento\Framework\App\ObjectManager;

Expand All @@ -18,7 +17,7 @@
* @since 100.0.2
* @SuppressWarnings(PHPMD.AllPurposeAction)
*/
abstract class Index extends Action implements HttpGetActionInterface
abstract class Index extends Action
{
/**
* Authorization level of a basic admin session
Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backup\Controller\Adminhtml\Index;

use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem;

class Create extends \Magento\Backup\Controller\Adminhtml\Index
/**
* Create backup controller
*/
class Create extends \Magento\Backup\Controller\Adminhtml\Index implements HttpPostActionInterface
{
/**
* Create backup action.
Expand Down
29 changes: 25 additions & 4 deletions app/code/Magento/Backup/Model/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\Backup\Model;

use Magento\Backup\Helper\Data as Helper;
use Magento\Backup\Model\ResourceModel\Table\GetListTables;
use Magento\Backup\Model\ResourceModel\View\CreateViewsBackup;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Exception\RuntimeException;

Expand Down Expand Up @@ -44,18 +46,35 @@ class Db implements \Magento\Framework\Backup\Db\BackupDbInterface
private $helper;

/**
* @param \Magento\Backup\Model\ResourceModel\Db $resourceDb
* @var GetListTables
*/
private $getListTables;

/**
* @var CreateViewsBackup
*/
private $getViewsBackup;

/**
* Db constructor.
* @param ResourceModel\Db $resourceDb
* @param \Magento\Framework\App\ResourceConnection $resource
* @param Helper|null $helper
* @param GetListTables|null $getListTables
* @param CreateViewsBackup|null $getViewsBackup
*/
public function __construct(
\Magento\Backup\Model\ResourceModel\Db $resourceDb,
ResourceModel\Db $resourceDb,
\Magento\Framework\App\ResourceConnection $resource,
?Helper $helper = null
?Helper $helper = null,
?GetListTables $getListTables = null,
?CreateViewsBackup $getViewsBackup = null
) {
$this->_resourceDb = $resourceDb;
$this->_resource = $resource;
$this->helper = $helper ?? ObjectManager::getInstance()->get(Helper::class);
$this->getListTables = $getListTables ?? ObjectManager::getInstance()->get(GetListTables::class);
$this->getViewsBackup = $getViewsBackup ?? ObjectManager::getInstance()->get(CreateViewsBackup::class);
}

/**
Expand Down Expand Up @@ -161,7 +180,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu

$this->getResource()->beginTransaction();

$tables = $this->getResource()->getTables();
$tables = $this->getListTables->execute();

$backup->write($this->getResource()->getHeader());

Expand Down Expand Up @@ -198,6 +217,8 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
$backup->write($this->getResource()->getTableDataAfterSql($table));
}
}
$this->getViewsBackup->execute($backup);

$backup->write($this->getResource()->getTableForeignKeysSql());
$backup->write($this->getResource()->getTableTriggersSql());
$backup->write($this->getResource()->getFooter());
Expand Down
Loading

0 comments on commit 81a4de8

Please sign in to comment.