Skip to content

Commit

Permalink
Merge branch '2.4-develop' into 30936-cms-perfomance
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel da Gama authored Jan 6, 2021
2 parents dc965fc + 95b1233 commit 65da3e6
Show file tree
Hide file tree
Showing 555 changed files with 15,325 additions and 1,919 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ indent_size = 2

[{composer, auth}.json]
indent_size = 4

[db_schema_whitelist.json]
indent_size = 4
trim_trailing_whitespace = false
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ private function fetchTierPrices(array $productIds): array
)
->where(
'ap.' . $productEntityLinkField . ' IN (?)',
$productIds
$productIds,
\Zend_Db::INT_TYPE
);

if ($priceFromFilter !== null) {
Expand Down
8 changes: 7 additions & 1 deletion app/code/Magento/Backend/App/Area/FrontNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ public function isHostBackend()
if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) {
$backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE);
} else {
$backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
$backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL);
if ($backendUrl === null) {
$backendUrl = $this->scopeConfig->getValue(
Store::XML_PATH_UNSECURE_BASE_URL,
ScopeInterface::SCOPE_STORE
);
}
}
$host = $this->request->getServer('HTTP_HOST', '');
return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false;
Expand Down
5 changes: 4 additions & 1 deletion app/code/Magento/Backend/Block/Widget/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
namespace Magento\Backend\Block\Widget;

use Magento\Backend\Block\Template\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Math\Random;
use Magento\Backend\Block\Template\Context;
use Magento\Framework\View\Helper\SecureHtmlRenderer;

/**
Expand Down Expand Up @@ -125,6 +125,9 @@ protected function _prepareAttributes($title, $classes, $disabled)
'value' => $this->getValue(),
'disabled' => $disabled,
];
if ($this->hasData('onclick_attribute')) {
$attributes['onclick'] = $this->getData('onclick_attribute');
}
if ($this->hasData('backend_button_widget_hook_id')) {
$attributes['backend-button-widget-hook-id'] = $this->getData('backend_button_widget_hook_id');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertLinkActionGroup">
<annotations>
<description>Assert text and url of the links.</description>
</annotations>
<arguments>
<argument name="text" type="string"/>
<argument name="url" type="string"/>
</arguments>

<seeLink userInput="{{text}}" url="{{url}}" stepKey="assertLinks"/>
</actionGroup>
</actionGroups>
59 changes: 40 additions & 19 deletions app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,70 +23,91 @@
<!-- Logging in Magento admin and checking for Privacy policy footer in dashboard -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<closeAdminNotification stepKey="closeAdminNotification"/>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkDashboard"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkDashboard">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in salesOrderPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSalesOrder">
<argument name="menuUiId" value="magento-sales-sales"/>
<argument name="submenuUiId" value="magento-sales-sales-order"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSalesOrder"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSalesOrder">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in catalogProductsPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCatalogProducts">
<argument name="menuUiId" value="magento-catalog-catalog"/>
<argument name="submenuUiId" value="magento-catalog-catalog-products"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCatalogProducts"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCatalogProducts">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in customersAllCustomersPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCustomersAllCustomers">
<argument name="menuUiId" value="magento-customer-customer"/>
<argument name="submenuUiId" value="magento-customer-customer-manage"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCustomersAllCustomers">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in marketingCatalogPriceRulePage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToMarketingCatalogPriceRule">
<argument name="menuUiId" value="magento-backend-marketing"/>
<argument name="submenuUiId" value="magento-catalogrule-promo-catalog"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in contentBlocksPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentBlocks">
<argument name="menuUiId" value="magento-backend-content"/>
<argument name="submenuUiId" value="magento-cms-cms-block"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkContentBlocks"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkContentBlocks">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in reportSearcbTermsPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsSearchTerms">
<argument name="menuUiId" value="magento-reports-report"/>
<argument name="submenuUiId" value="magento-search-report-search-term"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkReportsSearchTerms"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkReportsSearchTerms">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in storesAllStoresPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresAllStores">
<argument name="menuUiId" value="magento-backend-stores"/>
<argument name="submenuUiId" value="magento-backend-system-store"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkStoresAllStores"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkStoresAllStores">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in systemImportPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemImport">
<argument name="menuUiId" value="magento-backend-system"/>
<argument name="submenuUiId" value="magento-importexport-system-convert-import"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSystemImport"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSystemImport">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in findPartnersAndExtensionsPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions">
<argument name="menuUiId" value="magento-marketplace-partners"/>
<argument name="submenuUiId" value="magento-marketplace-partners"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"/>
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
</test>
</tests>

Expand Down
12 changes: 12 additions & 0 deletions app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,16 @@ public function getAttributesHtmlDataProvider()
]
];
}

/**
* Verifies ability of adding button onclick attribute
*
* @return void
*/
public function testOnClickAttribute(): void
{
$this->_blockMock->setData(['onclick_attribute' => 'value']);
$attributes = $this->_blockMock->getAttributesHtml();
$this->assertStringContainsString('onclick', $attributes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
* getPagerVisibility()
* getVarNamePage()
*/
$numColumns = count($block->getColumns());

/**
* @var \Magento\Backend\Block\Widget\Grid\Extended $block
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
*/
$numColumns = count($block->getColumns());

?>
<?php if ($block->getCollection()): ?>
<?php if ($block->canDisplayContainer()): ?>
Expand Down Expand Up @@ -285,7 +286,9 @@ $numColumns = count($block->getColumns());
</table>

</div>
<?php if ($block->canDisplayContainer()): ?>
</div>
<?php endif; ?>
<?php
/** @var \Magento\Framework\Json\Helper\Data $jsonHelper */
$jsonHelper = $block->getData('jsonHelper');
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Bundle/Model/ResourceModel/Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public function getParentIdsByChild($childId)
['e.entity_id as parent_product_id']
)->where(
$this->getMainTable() . '.product_id IN(?)',
$childId
$childId,
\Zend_Db::INT_TYPE
);

return $connection->fetchCol($select);
Expand Down
Loading

0 comments on commit 65da3e6

Please sign in to comment.