Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Browse files Browse the repository at this point in the history
Accepted Community Pull Requests:
 - magento#26779: Fix failure for missing product on Storefront (by @lbajsarowicz)
 - magento#27054: Cleanup ObjectManager usage - Magento_Authorization (by @Bartlomiejsz)
 - magento#27048: magento#27044 Integration Test to cover `$storeId` on Category Repository `get()` (by @lbajsarowicz)
 - magento#27041: FIX: responsiveness for images (by @GrimLink)
 - magento#25359: Fix magento#25243 (by @korostii)
 - magento#24784: Fix magento#20332 - address fields sort order fixes (by @Bartlomiejsz)
 - magento#27010: Unit test for UpdateElementTypesObserver (by @mmezhensky)
 - magento#27021: Unit test for \Magento\MediaGallery\Plugin\Product\Gallery\Processor (by @karyna-tsymbal-atwix)
 - magento#26765: Fix magento#17933 - Bank Transfer Payment Instructions switch back to default (by @Bartlomiejsz)
 - magento#26548: issue/26384 Fix store switcher when using different base url on stores (by @TobiasCodeNull)
 - magento#24003: Fixes less compilation problems in the Magento/luma theme (by @hostep)
 - magento#26329: MFTF: Replace invalid ActionGroup for AdminLogin (by @lbajsarowicz)


Fixed GitHub Issues:
 - magento#27044: BUG: Category Repository get()'s argument `store_id` does not work (reported by @lbajsarowicz) has been fixed in magento#27048 by @lbajsarowicz in 2.4-develop branch
   Related commits:
     1. 2d15e91
     2. 8ad33f5

 - magento#27040: Images no longer responsive (reported by @GrimLink) has been fixed in magento#27041 by @GrimLink in 2.4-develop branch
   Related commits:
     1. 691d7bb
     2. 6209f35
     3. bf78c2c
     4. 7e096c2

 - magento#25243: Numerical placeholder count in Phrase starts with %1, however js code assumes 0% (reported by @vitcra) has been fixed in magento#25359 by @korostii in 2.4-develop branch
   Related commits:
     1. 2596ca7
     2. 2f5909e
     3. d1b63cb
     4. f08857b
     5. 71ca4bb
     6. d79bf5e
     7. 3d36928
     8. 9db06e5
     9. df48d3e
     10. 9ccac04
     11. ce19171

 - magento#20332: Shipping address form City, State/Province, Zip/Postal Code, Country not in right Order in checkout  (reported by @swetacedcoss) has been fixed in magento#24784 by @Bartlomiejsz in 2.4-develop branch
   Related commits:
     1. 2d759c0

 - magento#17933: Bank Transer Payment Instuctions switch back to default (reported by @rstylenl) has been fixed in magento#26765 by @Bartlomiejsz in 2.4-develop branch
   Related commits:
     1. 7c4be6a

 - magento#23755: Store view switcher is wrong , when each store views have different url. (reported by @Taku-Yamashita) has been fixed in magento#26548 by @TobiasCodeNull in 2.4-develop branch
   Related commits:
     1. 346e544
     2. 392bd3b
     3. 0cbc5b6
     4. 420fa1c
     5. 1375b53
     6. 9cad4dc
     7. 6024195
     8. ee97fb5
     9. 689093a
     10. 4708394
     11. 597bb18
     12. 0fcb6a0

 - magento#26384: Store switcher redirects to homepage for multistore setup with different domains (reported by @DanieliMi) has been fixed in magento#26548 by @TobiasCodeNull in 2.4-develop branch
   Related commits:
     1. 346e544
     2. 392bd3b
     3. 0cbc5b6
     4. 420fa1c
     5. 1375b53
     6. 9cad4dc
     7. 6024195
     8. ee97fb5
     9. 689093a
     10. 4708394
     11. 597bb18
     12. 0fcb6a0

 - magento#23619: Less compilation extend 'mixin' has no matches (reported by @patruvlad) has been fixed in magento#24003 by @hostep in 2.4-develop branch
   Related commits:
     1. 820fd79
     2. 164a053
     3. 8419d5c
     4. 4abaaa0
     5. 5657076

 - magento#26331: [ MFTF ] Mess in ActionGroups: invalid names, multiple nodes. (reported by @lbajsarowicz) has been fixed in magento#26329 by @lbajsarowicz in 2.4-develop branch
   Related commits:
     1. aa1271b
     2. d013eff
     3. 5cd51d4
     4. d1a5d56
     5. e48c617
     6. 79797a7
     7. 7c4b59b
  • Loading branch information
magento-engcom-team authored Feb 28, 2020
2 parents 3455667 + aed9a17 commit a3c2af0
Show file tree
Hide file tree
Showing 808 changed files with 2,281 additions and 1,516 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAsAdmin">
<actionGroup name="AdminLoginActionGroup">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAdminWithCredentialsActionGroup">
<actionGroup name="LoginAdminWithCredentialsActionGroup" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
<actionGroup name="LoginAsAdmin" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemNotificationPage">
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
Expand All @@ -35,4 +35,4 @@
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</test>
</tests>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateAdvancedReportingPage">
<argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<group value="analytics"/>
</annotations>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<group value="analytics"/>
</annotations>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingServiceLabel}}" userInput="Advanced Reporting Service" stepKey="seeAdvancedReportingServiceLabelEnabled"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<group value="analytics"/>
</annotations>

<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<before>
<createData entity="adminNoReportRole" stepKey="noReportUserRole"/>
<createData entity="adminNoReport" stepKey="noReportUser"/>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<amOnPage url="{{AdminUsersPage.url}}" stepKey="amOnAdminUsersPage"/>
<fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="$$noReportUser.username$$" stepKey="fillUsernameSearch"/>
Expand All @@ -51,7 +51,7 @@
<scrollTo selector="{{AdminConfigAdvancedReportingSection.advancedReportingMenuItem}}" stepKey="scrollToMenuItem"/>
<!--<see stepKey="seeAdvancedReportingConfigMenuItem" selector="{{AdminConfigAdvancedReportingSection.advancedReportingMenuItem}}" userInput="Advanced Reporting"/>-->
<seeElementInDOM selector="{{AdminConfigAdvancedReportingSection.advancedReportingMenuItem}}" stepKey="seeAdvancedReportingConfigMenuItem"/>
<actionGroup ref="logout" stepKey="logoutOfAdmin2"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin2"/>

<amOnPage url="{{AdminLoginPage.url}}" stepKey="amOnAdminLoginPage"/>
<fillField selector="{{AdminLoginFormSection.username}}" userInput="$$noReportUser.username$$" stepKey="fillUsernameNoReport"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<group value="analytics"/>
</annotations>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustry}}" userInput="Apps and Games" stepKey="selectAdvancedReportingIndustry"/>
Expand Down
47 changes: 27 additions & 20 deletions app/code/Magento/Authorization/Model/Acl/Loader/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,46 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Authorization\Model\Acl\Loader;

use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
use Magento\Authorization\Model\Acl\Role\GroupFactory;
use Magento\Authorization\Model\Acl\Role\User as RoleUser;
use Magento\Framework\App\ObjectManager;
use Magento\Authorization\Model\Acl\Role\UserFactory;
use Magento\Framework\Acl\Data\CacheInterface;
use Magento\Framework\Acl\LoaderInterface;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Serialize\Serializer\Json;

class Role implements \Magento\Framework\Acl\LoaderInterface
/**
* Acl Role Loader
*/
class Role implements LoaderInterface
{
/**
* Cache key for ACL roles cache
*/
const ACL_ROLES_CACHE_KEY = 'authorization_role_cached_data';

/**
* @var \Magento\Framework\App\ResourceConnection
* @var ResourceConnection
*/
protected $_resource;

/**
* @var \Magento\Authorization\Model\Acl\Role\GroupFactory
* @var GroupFactory
*/
protected $_groupFactory;

/**
* @var \Magento\Authorization\Model\Acl\Role\UserFactory
* @var UserFactory
*/
protected $_roleFactory;

/**
* @var \Magento\Framework\Acl\Data\CacheInterface
* @var CacheInterface
*/
private $aclDataCache;

Expand All @@ -48,28 +57,26 @@ class Role implements \Magento\Framework\Acl\LoaderInterface
private $cacheKey;

/**
* @param \Magento\Authorization\Model\Acl\Role\GroupFactory $groupFactory
* @param \Magento\Authorization\Model\Acl\Role\UserFactory $roleFactory
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
* @param GroupFactory $groupFactory
* @param UserFactory $roleFactory
* @param ResourceConnection $resource
* @param CacheInterface $aclDataCache
* @param Json $serializer
* @param string $cacheKey
*/
public function __construct(
\Magento\Authorization\Model\Acl\Role\GroupFactory $groupFactory,
\Magento\Authorization\Model\Acl\Role\UserFactory $roleFactory,
\Magento\Framework\App\ResourceConnection $resource,
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null,
Json $serializer = null,
GroupFactory $groupFactory,
UserFactory $roleFactory,
ResourceConnection $resource,
CacheInterface $aclDataCache,
Json $serializer,
$cacheKey = self::ACL_ROLES_CACHE_KEY
) {
$this->_resource = $resource;
$this->_groupFactory = $groupFactory;
$this->_roleFactory = $roleFactory;
$this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get(
\Magento\Framework\Acl\Data\CacheInterface::class
);
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
$this->_resource = $resource;
$this->aclDataCache = $aclDataCache;
$this->serializer = $serializer;
$this->cacheKey = $cacheKey;
}

Expand Down
44 changes: 25 additions & 19 deletions app/code/Magento/Authorization/Model/Acl/Loader/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,38 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Authorization\Model\Acl\Loader;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Acl\Data\CacheInterface;
use Magento\Framework\Acl\LoaderInterface;
use Magento\Framework\Acl\RootResource;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Serialize\Serializer\Json;

class Rule implements \Magento\Framework\Acl\LoaderInterface
/**
* Acl Rule Loader
*/
class Rule implements LoaderInterface
{
/**
* Rules array cache key
*/
const ACL_RULE_CACHE_KEY = 'authorization_rule_cached_data';

/**
* @var \Magento\Framework\App\ResourceConnection
* @var ResourceConnection
*/
protected $_resource;

/**
* @var \Magento\Framework\Acl\RootResource
* @var RootResource
*/
private $_rootResource;

/**
* @var \Magento\Framework\Acl\Data\CacheInterface
* @var CacheInterface
*/
private $aclDataCache;

Expand All @@ -41,28 +49,26 @@ class Rule implements \Magento\Framework\Acl\LoaderInterface
private $cacheKey;

/**
* @param \Magento\Framework\Acl\RootResource $rootResource
* @param \Magento\Framework\App\ResourceConnection $resource
* @param array $data
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
* @param RootResource $rootResource
* @param ResourceConnection $resource
* @param CacheInterface $aclDataCache
* @param Json $serializer
* @param array $data
* @param string $cacheKey
* @SuppressWarnings(PHPMD.UnusedFormalParameter):
*/
public function __construct(
\Magento\Framework\Acl\RootResource $rootResource,
\Magento\Framework\App\ResourceConnection $resource,
RootResource $rootResource,
ResourceConnection $resource,
CacheInterface $aclDataCache,
Json $serializer,
array $data = [],
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null,
Json $serializer = null,
$cacheKey = self::ACL_RULE_CACHE_KEY
) {
$this->_resource = $resource;
$this->_rootResource = $rootResource;
$this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get(
\Magento\Framework\Acl\Data\CacheInterface::class
);
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
$this->_resource = $resource;
$this->aclDataCache = $aclDataCache;
$this->serializer = $serializer;
$this->cacheKey = $cacheKey;
}

Expand Down Expand Up @@ -104,7 +110,7 @@ private function getRulesArray()
return $this->serializer->unserialize($rulesCachedData);
}

$ruleTable = $this->_resource->getTableName("authorization_rule");
$ruleTable = $this->_resource->getTableName('authorization_rule');
$connection = $this->_resource->getConnection();
$select = $connection->select()
->from(['r' => $ruleTable]);
Expand Down
Loading

0 comments on commit a3c2af0

Please sign in to comment.