Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/2.3-develop' into MC-12396-sub…
Browse files Browse the repository at this point in the history
…total-excl-tax
  • Loading branch information
nmalevanec committed Mar 12, 2019
2 parents 6ae859a + 9d231d1 commit c25656b
Show file tree
Hide file tree
Showing 831 changed files with 27,795 additions and 5,276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
->processCountNewPrices($tierPrices);

$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
if ($listSku) {
$this->setUpdatedAt($listSku);
Expand Down Expand Up @@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)

$tableName = $this->_resourceFactory->create()->getTable($table);
$productEntityLinkField = $this->getProductEntityLinkField();
$existingPrices = $this->_connection->fetchAssoc(
$existingPrices = $this->_connection->fetchAll(
$this->_connection->select()->from(
$tableName,
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
)->where(
$productEntityLinkField . ' IN (?)',
$existProductIds
)
);
foreach ($existingPrices as $existingPrice) {
foreach ($prices as $sku => $skuPrices) {
Expand All @@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
foreach ($prices as $price) {
if ($existingPrice['all_groups'] == $price['all_groups']
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
&& (int) $existingPrice['qty'] === (int) $price['qty']
) {
$this->countItemsUpdated++;
continue;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
);
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
$this->connection->expects($this->once())
->method('fetchAssoc')
->method('fetchAll')
->willReturn($existingPrices);
$this->connection->expects($this->once())
->method('select')
Expand All @@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
->method('from')
->with(
self::TABLE_NAME,
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
)->willReturnSelf();
$this->advancedPricing->expects($this->once())
->method('retrieveOldSkus')
Expand Down
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminAdvancedReportingSection">
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminAdvancedReportingButtonTest">
<annotations>
<stories value="AdvancedReporting"/>
<title value="AdvancedReportingButtonTest"/>
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
<testCaseId value="MC-14800"/>
<severity value="CRITICAL"/>
<group value="analytics"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</test>
</tests>
7 changes: 7 additions & 0 deletions app/code/Magento/AuthorizenetAcceptjs/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<dev>
<js>
<minify_exclude>
<authorizenet_acceptjs>\.authorize\.net/v1/Accept</authorizenet_acceptjs>
</minify_exclude>
</js>
</dev>
<payment>
<authorizenet_acceptjs>
<active>0</active>
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>
3 changes: 2 additions & 1 deletion app/code/Magento/Backend/App/Request/BackendValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ private function createException(
$exception = new InvalidRequestException($response);
} else {
//For regular requests.
$startPageUrl = $this->backendUrl->getStartupPageUrl();
$response = $this->redirectFactory->create()
->setUrl($this->backendUrl->getStartupPageUrl());
->setUrl($this->backendUrl->getUrl($startPageUrl));
$exception = new InvalidRequestException(
$response,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Magento\Backend\Block\System\Design\Edit\Tab;

/**
* General system tab block.
*/
class General extends \Magento\Backend\Block\Widget\Form\Generic
{
/**
Expand Down Expand Up @@ -90,7 +93,7 @@ protected function _prepareForm()
]
);

$dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT);
$dateFormat = $this->_localeDate->getDateFormatWithLongYear();
$fieldset->addField(
'date_from',
'date',
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
Loading

0 comments on commit c25656b

Please sign in to comment.