-
Notifications
You must be signed in to change notification settings - Fork 9.4k
#21853: Allow mview indexers to use different entity columns. #21857
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
Merged
magento-engcom-team
merged 25 commits into
magento:2.4-develop
from
nikunjkotecha:21853
Jan 24, 2021
Merged
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
891198c
#21853: Allow mview indexers to use different entity columns.
7da4940
Merge branch '2.4-develop' into 21853
slavvka b59fc5a
#21853: Simplify the code change.
4035ec0
#21853: Correct the comment.
320ced7
21853: Send the view object and do all processing in buildStatement.
0d1ac3a
Merge branch '2.4-develop' into 21853
lenaorobei 6cbf85f
Merge branch '2.4-develop' into 21853
lenaorobei 7c2d2a6
#21853: Fix tests.
8388a90
#21853: Fix tests.
3f67ed8
Merge branch '2.4-develop' into 21853
VladimirZaets 873b814
Merge branch '2.4-develop' into 21853
engcom-Foxtrot 392dbf6
Merge branch '2.4-develop-mainline' into 21853
engcom-Foxtrot ff56be5
magento/magento2#21853: Allow mview indexers to use different entity …
engcom-Foxtrot e16f2c2
Merge branch '2.4-develop-mainline' into 21853
engcom-Foxtrot 922e029
Merge branch '2.4-develop' into 21853
engcom-Charlie 330d595
Merge branch '2.4-develop' into 21853
engcom-Charlie 4c1094a
extracted getting column to separate method
engcom-Charlie 69cee97
Merge branch '2.4-develop' into 21853
engcom-Charlie 46429a4
Merge branch '2.4-develop' into 21853
engcom-Charlie 4ad7aae
fix unit test
engcom-Charlie 8a9b768
define arguments & return types
engcom-Charlie db4cf23
Merge branch '2.4-develop' into 21853
engcom-Charlie 094decc
Merge branch '2.4-develop' into 21853
engcom-Charlie 910eb41
fixing conflict merge; fixed unit test
engcom-Charlie be3f84b
Merge branch '2.4-develop' into 21853
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution looks like we are trying to hack the subscription logic by changing object property and misuse the
columnName
.What we actually need is subscription column name, not the changelog column name (which is all the time the same).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lenaorobei I looked at the code again and your comment and it's a bit confusing
1/ It seems we both agree we need to use the subscription column name
2/ I'm not sure why you mention
not the changelog column name
, we need two column names - changelog column is for the changelog table and that's not going to change (even you mentioned same). What we need is to change how we read the subscription column nameMy understanding, Subscription is created once for all the subscribers together and whichever subscription we modify last - columnName is used from that and re-used for all the triggers.
I've tried to simplify the code to make it look not (or less) hacky but to me it seems changes are required in the same direction as I've taken or a major rework would be required in how the subscriptions are created (refactor how the statement is built for linked views)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, we need both changelog and subscription column names, but
$this->getColumnName()
is changelog column, not the subscription one.I recommended to move the logic of getting its name to the
buildStatement
method in order to cover both cases - create and delete.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any object / data available as of now in buildStatement to get the column name of the linked view for which buildStatement is called.
We can pass full view object or the way I've done to pass the subscription name, please advice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we can get
view
from thechangelog
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not at-least as per the interface
https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php
I may be wrong, please guide if I'm missing something here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
Let's pass the view object then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated