-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Corrected scope of _construct to protected #25537
base: 2.5-develop
Are you sure you want to change the base?
Conversation
Hi @dfelton. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
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.
Hi @dfelton. Thank you for your suggestion. From my point of view, we should make sure that by bringing this change we make more improvements than breakdowns.
From the backward compatibility perspective, there's a high chance that some 3rd party implementation overrides the construct method. In that way, this change has a chance to break a lot of existing setups. So we should not do that even in 2.4. Especially considering the fact that the modified class is marked as @api
.
Thank you for your feedback @rogyar. May I please continue the conversation here, under the goal for myself to gain a further understanding.
Are you stating that if this scope change were to ever occur in Magento 2.x.x, it should be accommodated with other changes that further improve the application, or that the very act of changing this, should improve the application over cause a breakdown? If the former, it would seem to me that it would only then ever be "snuck into" a PR that contains improvements unrelated to this line change. If the latter, I do understand the mentality of "don't fix what isn't broken"... But then it seems to me a simple typo here is now forced to remain in Magento 2.x for the remainder of it's life cycle, until Magento 3.x.
I apologize but I fail to see how this scope change would cause backwards incompatible changes for this particular scenario. If a third party implementation has overridden the construct method then:
However, in acknowledgement of your concern, it is possible that third party extensions have implemented The other scenario, would be no override|plugin at all, and the method is simply called outside the context of At the end of the day, I don't really feel strongly here one way or the other. If we decide to close out this PR without this change merged that's fine with me. Leaving this as Thank you for your time. |
Hi @dfelton. I got your point. Make sense for me. Let me bring this change to the internal discussion. I will get back to you with the decision. Thank you! |
@rogyar is there any updates? Did you finished discussion? |
I'm moving to "to approve" as this is backward incompatible change and it should be approved. |
Hi @ihor-sviziev. Thank you for the reminder. Yes, we have previously discussed that point. Approving |
@magento run all tests |
Hi @rogyar, thank you for the review.
|
✔️ QA passed |
@ishakhsuvarov, maybe you can push it? it's a pretty tiny fix. I would merge OR decide to just close it |
_construct() is intended to act as a "mock" constructor and not supposed to be accessed outside of the context of $this
3696df3
to
0e30e82
Compare
@ihor-sviziev I have force-pushed to my branch a fresh rebasing from |
Referring to the comment as this PR is already QA passed. Hence, moving this PR to extended testing as builds are failed. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Moving this PR to on hold since we are not picking up any PRs against the 2.5-develop branch right now. Once we pick it up, we will move it to the appropriate status. |
Description
Corrects the scope of _construct() method in
Magento\Cron\Model\ResourceModel\Schedule.php
.Fixed Issues (if relevant)
None.
Manual testing scenarios (*)
No tests performed. However I did perform a scan of the code base to ensure _construct() is never currently called outside of the context of
$this
.Questions or comments
This should really be a PR into 2.4-develop as this is a non-backwards compatible change. However no such branch exists for me to open a PR to.
While this does not break any functionality within Magento itself, it is potentially possible that developers have (against best practices) performed in their code something similar to the following:
Contribution checklist (*)
Resolved issues: