Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MC-36959 Remove "compareArraysRecursively" logic duplication #29733

Merged
merged 145 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
a4c74d8
Implement ActionInterface for Wishlist/Shared
Mar 30, 2020
18e7519
Unit test for Wishlist/Shared Controller
Mar 30, 2020
a002bf2
PSR2 linted
Mar 30, 2020
df2c759
Implement ActionInterface for Wishlist/Shared/Cart + unit test
Mar 30, 2020
3ac458b
Static test fixes
May 13, 2020
935bdfa
conflicts resolved; Merge branch '2.4-develop' into refactor/wishlist
May 13, 2020
f474439
suppress ExcessiveMethodLength notice
May 13, 2020
204d0c3
Grammar fixes in Registry.php
Ynhockey Jun 4, 2020
eface05
Use Variable for border-radius
Scarbous Jun 5, 2020
9bd16ba
Merge branch '2.4-develop' into patch-1
Scarbous Jun 5, 2020
2dfa221
#28802: Fix typo retires => retries
medigeek Jun 19, 2020
2ce3982
Merge branch '2.4-develop' into refactor/wishlist
Jun 26, 2020
4a85364
added extend Action back, updated tests
Jun 26, 2020
979ab1f
removed unnecessary properties
Jun 29, 2020
2f65f66
Merge branch '2.4-develop' into refactor/wishlist
Jun 29, 2020
6d8f77c
fixed tests
Jun 29, 2020
2616ba1
fixed tests
Jun 29, 2020
e2db162
reverted fixed tests
Jun 30, 2020
2f08064
objectmanager added to test
Jun 30, 2020
9a1da8a
Merge branch '2.4-develop' into refactor/wishlist
engcom-Charlie Jul 3, 2020
21f9fa4
impr
engcom-Charlie Jul 3, 2020
1b0f8df
Enabling Email To Friend Functionality
DmitryTsymbal Jul 8, 2020
680ca2b
Added testCaseId to MFTF test.
engcom-Kilo Jul 15, 2020
2a76cb3
Merge branch '2.4-develop' into enableEmailToFriendFunctionality
engcom-Kilo Jul 15, 2020
44a6504
Severity adding
DmitryTsymbal Jul 17, 2020
d95fa18
reformat code
DmitryTsymbal Jul 17, 2020
a59cd76
Merge branch '2.4-develop' into patch-1
Scarbous Jul 19, 2020
53d86d7
Merge branch '2.4-develop' into enableEmailToFriendFunctionality
engcom-Kilo Jul 22, 2020
e786d51
magento/magento2#29315: \Magento\Config\Model\Config\Source\Email\Tem…
guidance-automotan Jul 29, 2020
e0972bf
magento/magento2#29315: \Magento\Config\Model\Config\Source\Email\Tem…
guidance-automotan Jul 30, 2020
8f43c63
community-features#252 Create static test for action controllers.
Jul 30, 2020
f9ed85c
Merge branch '2.4-develop' into community-features-252
swnsma Jul 30, 2020
602dc68
Update dev/tests/static/testsuite/Magento/Test/Legacy/Magento/App/Act…
swnsma Jul 31, 2020
7181dbc
Merge branch '2.4-develop' into community-features-252
swnsma Jul 31, 2020
9342d4c
community-features#252 Create static test for action controllers.
Jul 31, 2020
8195b0c
community-features#252 Create static test for action controllers.
Jul 31, 2020
26cd80d
Merge branch '2.4-develop' into refactor/wishlist
ihor-sviziev Jul 31, 2020
f4e35ba
Merge branch '2.4-develop' into community-features-252
swnsma Aug 2, 2020
308a5f4
community-features#252 Create static test for action controllers.
Aug 3, 2020
73f93d1
Merge branch 'community-features-252' of github.com:swnsma/magento2-1…
Aug 4, 2020
d29e8a7
Merge branch '2.4-develop' into community-features-252
swnsma Aug 4, 2020
125a5d4
community-features#252 Create static test for action controllers.
Aug 4, 2020
ca31a93
Merge branch 'community-features-252' of github.com:swnsma/magento2-1…
Aug 4, 2020
87a70e9
community-features#252 Create static test for action controllers.
Aug 4, 2020
4b5eb90
Merge branch '2.4-develop' into community-features-252
swnsma Aug 4, 2020
0b92de9
community-features#252 Create static test for action controllers.
Aug 4, 2020
019b611
Merge branch 'community-features-252' of github.com:swnsma/magento2-1…
Aug 5, 2020
a493bc5
community-features#252 Create static test for action controllers..
Aug 5, 2020
398801c
Merge branch '2.4-develop' into community-features-252
swnsma Aug 5, 2020
8e011b6
created new action group for click button
Usik2203 Aug 10, 2020
83b4012
Add action group for click edit link
Usik2203 Aug 10, 2020
1b39196
fix store website name rewrites
engcom-Charlie Aug 11, 2020
c5f6a1f
fix http action
engcom-Charlie Aug 12, 2020
4d65656
MC-35699: [Magento Cloud] HTML minification strips triple slashes fro…
tsviklinskyi Aug 12, 2020
a7da7fd
add get
engcom-Charlie Aug 12, 2020
1a7c8cd
Fixed the resending Newsletter confirmation issue
konarshankar07 Aug 13, 2020
895c284
Refactor not needed beofre and around plugins
ihor-sviziev Aug 13, 2020
6e53e0d
Fixed Unit Tests
konarshankar07 Aug 14, 2020
b213b79
Refactor not needed before and around plugins
ihor-sviziev Aug 14, 2020
4f90cf5
MC-36533: Orders with Zero Sum Payment Method are Closed automatically
nikita-shcherbatykh Aug 14, 2020
4164d21
Merge branch '2.4-develop' into community-features-252
engcom-Kilo Aug 14, 2020
47d32a2
MC-36533: Orders with Zero Sum Payment Method are Closed automatically
nikita-shcherbatykh Aug 14, 2020
987b162
Refactor Category Link: Replace deprecated interface, clean the code
lbajsarowicz Aug 15, 2020
77135cf
Fis Static Tests
lbajsarowicz Aug 15, 2020
8eb39b8
Fis Static Tests
lbajsarowicz Aug 15, 2020
86518bd
MC-36024: Invalid Character Customer Account Create DOB
tsviklinskyi Aug 17, 2020
597d072
MC-36652: Restricted admin can view "Products in Carts" from all webs…
tsviklinskyi Aug 18, 2020
9a98048
MFTF has been added.
engcom-Hotel Aug 18, 2020
5fbb3cf
Merge branch '2.4-develop' into fix_store_name_rewrite
engcom-Hotel Aug 18, 2020
674a2f8
add AdminOrderClickSubmitOrderActionGroup
Usik2203 Aug 18, 2020
d1abc9d
Fix flaky behavior with mftf test
Nazar65 Aug 18, 2020
c5f99cf
MC-36748: strpos() expects parameter 1 to be string, bool given
Aug 14, 2020
db92989
MC-36748: strpos() expects parameter 1 to be string, bool given
Aug 14, 2020
4b0fdfc
Minor Refactor
lbajsarowicz Aug 18, 2020
6b01af9
Refactor Unit Tests too
lbajsarowicz Aug 18, 2020
bc5e644
Refactor Unit Tests too (remove "expects any()")
lbajsarowicz Aug 18, 2020
f0264c9
Minor refactoring to AccessChangeQuoteControl and it's Unit Tests
lbajsarowicz Aug 18, 2020
ea584f9
Fixed cyclomatic complexity
konarshankar07 Aug 19, 2020
ab3db16
Fixed static test
konarshankar07 Aug 19, 2020
de733ae
Merge branch '2.4-develop' into add-action-group-submit-order
engcom-Charlie Aug 19, 2020
070749d
Merge branch '2.4-develop' into ASI-1764
sivaschenko Aug 19, 2020
59e03dc
ENGCOM-8023: [MFTF] Add new AdminOrderClickSubmitOrderActionGroup #29630
magento-engcom-team Aug 19, 2020
e31086a
ENGCOM-8028: ChangeQuoteControl minor refactor #29669
magento-engcom-team Aug 19, 2020
5374385
ENGCOM-8027: Minor refactoring to AccessChangeQuoteControl and it's U…
magento-engcom-team Aug 19, 2020
97be07f
ENGCOM-7927: community-features#252 Create static test for action con…
magento-engcom-team Aug 19, 2020
152c29b
rename action group
Usik2203 Aug 19, 2020
fca9f6f
Merge branch '2.4-develop' into click-edit-link-for-customer-edit
Usik2203 Aug 19, 2020
1aca725
rename action group
Usik2203 Aug 19, 2020
b5ec5cd
Merge branch '2.4-develop' into click-button-create-tax-rule
Usik2203 Aug 19, 2020
e91b9ff
ENGCOM-7961: Fix for magento/magento2#29315: \Magento\Config\Model\Co…
magento-engcom-team Aug 19, 2020
46b09cc
ENGCOM-8013: Refactor not needed before and around plugins #29518
magento-engcom-team Aug 19, 2020
9d0e0af
ENGCOM-8016: Refactor Category Link: Replace deprecated interface, cl…
magento-engcom-team Aug 19, 2020
653650f
Revert "Add validation phone field on checkout page"
engcom-Charlie Aug 19, 2020
902b840
ENGCOM-8024: [MFTF] AdminMediaGalleryCatalogUiEditCategoryGridPageTes…
magento-engcom-team Aug 19, 2020
5023570
MC-36671: Extend catalog GraphQl tests coverage
le0n4ik Aug 19, 2020
d3dd40b
Merge remote-tracking branch 'mainline/2.4-develop' into 2.4-develop-…
Aug 19, 2020
eb50002
Merge pull request #6040 from magento-engcom/2.4-develop-MC-36748
sidolov Aug 20, 2020
af54db3
improve test
engcom-Charlie Aug 20, 2020
2aa809b
Merge remote-tracking branch 'origin/MC-35699' into 2.4-develop-pr38
serhii-balko Aug 20, 2020
269eae6
Merge remote-tracking branch 'origin/MC-36533' into 2.4-develop-pr38
serhii-balko Aug 20, 2020
b3ad364
Merge remote-tracking branch 'origin/MC-36024' into 2.4-develop-pr38
serhii-balko Aug 20, 2020
a89f35d
Merge remote-tracking branch 'origin/MC-36652' into 2.4-develop-pr38
serhii-balko Aug 20, 2020
b0eec73
Merge pull request #6049 from magento-tsg-csl3/2.4-develop-pr38
zakdma Aug 20, 2020
cf221f4
ENGCOM-8040: [MFTF]Add new ActionGroup #29459
magento-engcom-team Aug 20, 2020
5565349
Update AdminCreateDuplicateNameStoreViewTest.xml
engcom-Kilo Aug 20, 2020
e1c4b66
ENGCOM-8041: improve test AccountTest #29693
magento-engcom-team Aug 20, 2020
8488a5a
ENGCOM-8040: [MFTF]Add new ActionGroup #29459
sidolov Aug 20, 2020
bc95fa4
ENGCOM-8028: ChangeQuoteControl minor refactor #29669
sidolov Aug 20, 2020
3c4b977
ENGCOM-8027: Minor refactoring to AccessChangeQuoteControl and it's U…
sidolov Aug 20, 2020
d8406c8
ENGCOM-8024: [MFTF] AdminMediaGalleryCatalogUiEditCategoryGridPageTes…
sidolov Aug 20, 2020
fe19a9d
ENGCOM-8023: [MFTF] Add new AdminOrderClickSubmitOrderActionGroup #29630
sidolov Aug 20, 2020
0b46e11
ENGCOM-8016: Refactor Category Link: Replace deprecated interface, cl…
sidolov Aug 20, 2020
c86883b
ENGCOM-8013: Refactor not needed before and around plugins #29518
sidolov Aug 20, 2020
fe4f3e0
ENGCOM-7961: Fix for magento/magento2#29315: \Magento\Config\Model\Co…
sidolov Aug 20, 2020
81b42be
ENGCOM-7927: community-features#252 Create static test for action con…
sidolov Aug 20, 2020
1c13119
ENGCOM-8032: Revert 'Add validation phone field on checkout page' #29682
magento-engcom-team Aug 20, 2020
01e90b1
Fixed bad code style in return type declaration
Aug 20, 2020
83bd060
ENGCOM-8041: improve test AccountTest #29693
sidolov Aug 20, 2020
45fe483
ENGCOM-8032: Revert "Add validation phone field on checkout page" #29682
sidolov Aug 20, 2020
53bcc78
:arrows_clockwise: [Magento Community Engineering] Community Contribu…
magento-engcom-team Aug 20, 2020
ac83c58
[Magento Community Engineering] Community Contributions - 2.4-develop
magento-engcom-team Aug 20, 2020
8b7d949
:arrows_clockwise: [Magento Community Engineering] Community Contribu…
magento-engcom-team Aug 21, 2020
7df7ae3
Merge branch '2.4-develop' into click-edit-link-for-customer-edit
engcom-Charlie Aug 21, 2020
4c93579
ENGCOM-7997: fix Same store name overriding in the store view grid fi…
magento-engcom-team Aug 21, 2020
ccad1d1
ENGCOM-8043: [MFTF] Add ActionGroup for clicking edit link on custome…
magento-engcom-team Aug 21, 2020
ec8a262
ENGCOM-8034: #28422 :- Newsletter subscription confirmation email nev…
magento-engcom-team Aug 21, 2020
e9ac642
ENGCOM-8053: Fixed the wrong code style in return type declaration #2…
magento-engcom-team Aug 21, 2020
f9ad1c8
ENGCOM-7779: Implement ActionInterface for wishlist/shared #27494
magento-engcom-team Aug 21, 2020
2f854a4
ENGCOM-8053: Fixed the wrong code style in return type declaration #2…
sidolov Aug 21, 2020
13c29a2
ENGCOM-8043: [MFTF] Add ActionGroup for clicking edit link on custome…
sidolov Aug 21, 2020
9de03f5
ENGCOM-8034: #28422 :- Newsletter subscription confirmation email nev…
sidolov Aug 21, 2020
df3b84f
ENGCOM-7997: fix Same store name overriding in the store view grid fi…
sidolov Aug 21, 2020
3a0a30f
ENGCOM-7779: Implement ActionInterface for wishlist/shared #27494
sidolov Aug 21, 2020
4ab6e3b
ENGCOM-7630: Use Variable for border-radius #28548
magento-engcom-team Aug 21, 2020
4a10d54
ENGCOM-7716: #28802: Fix typo retires => retries #28816
magento-engcom-team Aug 21, 2020
dccd8a1
ENGCOM-8058: Grammar fixes in Registry.php PHPDoc #28512
magento-engcom-team Aug 21, 2020
c31c55f
ENGCOM-7804: MFTF: Enabling Email To Friend Functionality. Assert Opt…
magento-engcom-team Aug 21, 2020
14e3191
ENGCOM-8058: Grammar fixes in Registry.php PHPDoc #28512
sidolov Aug 21, 2020
c6e48ab
ENGCOM-7804: MFTF: Enabling Email To Friend Functionality. Assert Opt…
sidolov Aug 21, 2020
9ede49c
ENGCOM-7716: #28802: Fix typo retires => retries #28816
sidolov Aug 21, 2020
aac9be8
ENGCOM-7630: Use Variable for border-radius #28548
sidolov Aug 21, 2020
03aecf2
[Magento Community Engineering] Community Contributions - 2.4-develop…
magento-engcom-team Aug 21, 2020
7fbae46
:arrows_clockwise: [Magento Community Engineering] Community Contribu…
magento-engcom-team Aug 24, 2020
f80022b
Merge branch '2.4-develop' of github.com:magento/magento2ce into 2.4-…
le0n4ik Aug 24, 2020
db188b6
MC-36959: Remove "compareArraysRecursively" logic duplication
le0n4ik Aug 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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="AdminNavigateToEmailToFriendSettingsActionGroup">
<amOnPage url="{{AdminConfigurationEmailToFriendPage.url}}" stepKey="navigateToPersistencePage"/>
<conditionalClick selector="{{AdminEmailToFriendSection.DefaultLayoutsTab}}" dependentSelector="{{AdminEmailToFriendSection.CheckIfTabExpand}}" visible="true" stepKey="clickTab"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertAdminEmailToFriendOptionsAvailableActionGroup">
<seeElement stepKey="seeEmailTemplateInput" selector="{{AdminEmailToFriendSection.emailTemplate}}"/>
<seeElement stepKey="seeAllowForGuestsInput" selector="{{AdminEmailToFriendSection.allowForGuests}}"/>
<seeElement stepKey="seeMaxRecipientsInput" selector="{{AdminEmailToFriendSection.maxRecipients}}"/>
<seeElement stepKey="seeMaxPerHourInput" selector="{{AdminEmailToFriendSection.maxPerHour}}"/>
<seeElement stepKey="seeLimitSendingBy" selector="{{AdminEmailToFriendSection.limitSendingBy}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminConfigurationEmailToFriendPage" url="admin/system_config/edit/section/sendfriend/" module="Catalog" area="admin">
<section name="AdminEmailToFriendSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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="AdminCatalogEmailToFriendSettingsTest">
<annotations>
<features value="Backend"/>
<stories value="Enable Email To A Friend Functionality"/>
<title value="Admin should be able to manage settings of Email To A Friend Functionality"/>
<description value="Admin should be able to enable Email To A Friend functionality in Magento Admin backend and see additional options"/>
<group value="backend"/>
<severity value="MINOR"></severity>
<testCaseId value="MC-35895"/>
</annotations>

<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<magentoCLI stepKey="enableSendFriend" command="config:set sendfriend/email/enabled 1"/>
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
</before>
<after>
<magentoCLI stepKey="disableSendFriend" command="config:set sendfriend/email/enabled 0"/>
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<actionGroup ref="AdminNavigateToEmailToFriendSettingsActionGroup" stepKey="navigateToSendFriendSettings"/>
<actionGroup ref="AssertAdminEmailToFriendOptionsAvailableActionGroup" stepKey="assertOptions"/>
</test>
</tests>
2 changes: 1 addition & 1 deletion app/code/Magento/Captcha/CustomerData/Captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
/**
* @inheritdoc
*/
public function getSectionData() :array
public function getSectionData(): array
{
$data = [];

Expand Down
35 changes: 18 additions & 17 deletions app/code/Magento/Catalog/Model/CategoryLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,41 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Catalog\Model;

use Magento\Catalog\Api\Data\CategoryLinkExtensionInterface;
use Magento\Catalog\Api\Data\CategoryLinkInterface;
use Magento\Framework\Model\AbstractExtensibleModel;

/**
* @codeCoverageIgnore
*/
class CategoryLink extends \Magento\Framework\Api\AbstractExtensibleObject implements
\Magento\Catalog\Api\Data\CategoryLinkInterface
class CategoryLink extends AbstractExtensibleModel implements CategoryLinkInterface
{
/**#@+
* Constants
*/
const KEY_POSITION = 'position';
const KEY_CATEGORY_ID = 'category_id';
/**#@-*/
public const KEY_POSITION = 'position';
public const KEY_CATEGORY_ID = 'category_id';

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getPosition()
{
return $this->_get(self::KEY_POSITION);
return $this->getData(self::KEY_POSITION);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getCategoryId()
{
return $this->_get(self::KEY_CATEGORY_ID);
return $this->getData(self::KEY_CATEGORY_ID);
}

/**
* @inheritDoc
*
* @param int $position
* @return $this
*/
Expand All @@ -56,7 +58,7 @@ public function setCategoryId($categoryId)
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @return \Magento\Catalog\Api\Data\CategoryLinkExtensionInterface|null
*/
Expand All @@ -66,14 +68,13 @@ public function getExtensionAttributes()
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @param \Magento\Catalog\Api\Data\CategoryLinkExtensionInterface $extensionAttributes
* @return $this
*/
public function setExtensionAttributes(
\Magento\Catalog\Api\Data\CategoryLinkExtensionInterface $extensionAttributes
) {
public function setExtensionAttributes(CategoryLinkExtensionInterface $extensionAttributes)
{
return $this->_setExtensionAttributes($extensionAttributes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
*/
namespace Magento\Catalog\Model\Indexer\Category\Flat\Plugin;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Indexer\IndexerRegistry;
use Magento\Catalog\Model\Indexer\Category\Flat\State;
use Magento\Framework\Indexer\IndexerRegistry;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class StoreGroup
{
/**
* @var bool
*/
private $needInvalidating;

/**
* @var IndexerRegistry
*/
Expand Down Expand Up @@ -48,35 +43,21 @@ protected function validate(AbstractModel $group)
return $group->dataHasChangedFor('root_category_id') && !$group->isObjectNew();
}

/**
* Check if need invalidate flat category indexer
*
* @param AbstractDb $subject
* @param AbstractModel $group
*
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforeSave(AbstractDb $subject, AbstractModel $group)
{
$this->needInvalidating = $this->validate($group);
}

/**
* Invalidate flat category indexer if root category changed for store group
*
* @param AbstractDb $subject
* @param AbstractDb $objectResource
*
* @param AbstractDb $result
* @param AbstractModel $group
* @return AbstractDb
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterSave(AbstractDb $subject, AbstractDb $objectResource)
public function afterSave(AbstractDb $subject, AbstractDb $result, AbstractModel $group)
{
if ($this->needInvalidating && $this->state->isFlatEnabled()) {
if ($this->validate($group) && $this->state->isFlatEnabled()) {
$this->indexerRegistry->get(State::INDEXER_ID)->invalidate();
}

return $objectResource;
return $result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
*/
namespace Magento\Catalog\Model\Indexer\Category\Product\Plugin;

use Magento\Framework\Indexer\IndexerRegistry;
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
use Magento\Framework\Model\AbstractModel;
use Magento\Catalog\Model\Indexer\Category\Product;
use Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer;
use Magento\Framework\Indexer\IndexerRegistry;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class StoreGroup
{
/**
* @var bool
*/
private $needInvalidating;

/**
* @var IndexerRegistry
*/
Expand All @@ -40,36 +35,23 @@ public function __construct(
$this->tableMaintainer = $tableMaintainer;
}

/**
* Check if need invalidate flat category indexer
*
* @param AbstractDb $subject
* @param AbstractModel $group
*
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforeSave(AbstractDb $subject, AbstractModel $group)
{
$this->needInvalidating = $this->validate($group);
}

/**
* Invalidate flat product
*
* @param AbstractDb $subject
* @param AbstractDb $objectResource
* @param AbstractDb $result
* @param AbstractModel $group
*
* @return AbstractDb
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterSave(AbstractDb $subject, AbstractDb $objectResource)
public function afterSave(AbstractDb $subject, AbstractDb $result, AbstractModel $group)
{
if ($this->needInvalidating) {
if ($this->validate($group)) {
$this->indexerRegistry->get(Product::INDEXER_ID)->invalidate();
}

return $objectResource;
return $result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
*/
namespace Magento\Catalog\Model\Indexer\Category\Product\Plugin;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class StoreView extends StoreGroup
{
/**
* Validate changes for invalidating indexer
*
* @param \Magento\Framework\Model\AbstractModel $store
* @param AbstractModel $store
* @return bool
*/
protected function validate(\Magento\Framework\Model\AbstractModel $store)
protected function validate(AbstractModel $store)
{
return $store->isObjectNew() || $store->dataHasChangedFor('group_id');
}
Expand All @@ -36,7 +36,7 @@ public function afterSave(AbstractDb $subject, AbstractDb $objectResource, Abstr
$this->tableMaintainer->createTablesForStore($store->getId());
}

return parent::afterSave($subject, $objectResource);
return parent::afterSave($subject, $objectResource, $store);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,46 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Model\Indexer\Product\Eav\Plugin;

use Magento\Catalog\Model\Indexer\Product\Eav\Processor;
use Magento\Framework\Model\AbstractModel;
use Magento\Store\Model\ResourceModel\Store;

class StoreView
{
/**
* Product attribute indexer processor
*
* @var \Magento\Catalog\Model\Indexer\Product\Eav\Processor
* @var Processor
*/
protected $_indexerEavProcessor;

/**
* @param \Magento\Catalog\Model\Indexer\Product\Eav\Processor $indexerEavProcessor
* @param Processor $indexerEavProcessor
*/
public function __construct(\Magento\Catalog\Model\Indexer\Product\Eav\Processor $indexerEavProcessor)
public function __construct(Processor $indexerEavProcessor)
{
$this->_indexerEavProcessor = $indexerEavProcessor;
}

/**
* Before save handler
*
* @param \Magento\Store\Model\ResourceModel\Store $subject
* @param \Magento\Framework\Model\AbstractModel $object
* @param Store $subject
* @param Store $result
* @param AbstractModel $object
*
* @return void
* @return Store
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforeSave(
\Magento\Store\Model\ResourceModel\Store $subject,
\Magento\Framework\Model\AbstractModel $object
) {
if ((!$object->getId() || $object->dataHasChangedFor('group_id')) && $object->getIsActive()) {
public function afterSave(Store $subject, Store $result, AbstractModel $object)
{
if (($object->isObjectNew() || $object->dataHasChangedFor('group_id')) && $object->getIsActive()) {
$this->_indexerEavProcessor->markIndexerAsInvalid();
}

return $result;
}
}
Loading