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
Drop requirement for plugin «name» when «type» attribute is present #2297
Comments
Plugin name is required for ability to rewrite plugin type. |
I have said the same in my 1th sentence. What is about my 2nd sentence? |
So if plugin declaration is missing attribute "name", the "type" attribute for such plugin can not be overridden in other module, because "type" now becomes identifier. To allow "type" override, we need "name" as identifier for all plugins. |
It can.
By the way (not the puprose of the issue), the overrider looks more clear when specifying |
Oh, I see your idea now. It might work, but It mixes values of different nodes, which is confusing for developer. Also It would require specific customized configuration merger. And it's different from what we do in any configuration type. Alternative approach would be to remove feature of plugin type rewrite (I don't know scenarios for this), but that would be a breaking change. |
Yes, 99% of plugins declarations are of type 1
so making the |
Just to clarify: I think that making name optional would be confusing for developers. It should either stay as is, or name attribute should be removed at all. |
The GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or Magento Stack Exchange site for technical questions. In your case, the programming questions forum is likely the most appropriate. Feel free to reopen this issue if you think you have encountered a bug in Magento 2. |
I propose to do a good desion before the Release, otherwise it would hard to do it in the next 7-8 years because of compatibility importance. |
[TSG] Upporting for 2.3 (pr7) (2.3.0)
As I see, the sole purpose of the
name
attribute is to allow the plugin to be redefined by an extension.I propose to make the
name
attribute optional (not required) and use thetype
attribute value as the name when thename
attribute is absent.It would reduce an amount of code, so a developer can write
instead of
The text was updated successfully, but these errors were encountered: