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

magento/devdocs#6535: Clarify behavior of plugins in Plugins (Interceptors) topic #6811

Merged
merged 3 commits into from
Mar 12, 2020

Conversation

atwixfirster
Copy link
Contributor

@atwixfirster atwixfirster commented Mar 8, 2020

Purpose of this pull request

This pull request (PR) provides additional explanations for plugins order execution regarding to #6535.

Affected DevDocs pages

Links to Magento source code

whatsnew
Added execution order examples to Plugin (Interceptors).

@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

The execution will be in this order:

* `PluginA::beforeDispatch()`
* `PluginB::beforeDispatch()`
* `PluginB::aroundDispatch()` (Magento calls the first half until `callable`)
* `PluginB::aroundDispatch()` (Magento calls the first half after `callable`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this statement is 100% correct. The around plugin is supposed to be executed before callable and after callable. In the modified example it's being executed two times before callable.

*  `PluginB::aroundDispatch()` (Magento calls the first half after `callable`)
*  `PluginB::aroundDispatch()` (Magento calls the second half after `callable`)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @rogyar !

fixed

Thank you!

@rogyar rogyar added the Major Update Significant original updates to existing content label Mar 8, 2020
@dobooth dobooth added the 2.3.x Magento 2.3 related changes label Mar 12, 2020
@dobooth
Copy link
Contributor

dobooth commented Mar 12, 2020

running tests

@dobooth dobooth merged commit 9c26427 into magento:master Mar 12, 2020
@ghost
Copy link

ghost commented Mar 12, 2020

Hi @atwixfirster, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sidolov sidolov added Major Update Significant original updates to existing content and removed Major Update Significant original updates to existing content labels Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.3.x Magento 2.3 related changes Major Update Significant original updates to existing content Partner: Atwix partners-contribution PR created by Magento partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants