-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix init of TC module #3511
Fix init of TC module #3511
Conversation
$this->container->singleton( Module::class ); | ||
// We need to init for the registration as a module to take place early. | ||
$this->container->get( Module::class ); |
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->container->singleton( Module::class ); | |
// We need to init for the registration as a module to take place early. | |
$this->container->get( Module::class ); | |
// We need to init for the registration as a module to take place early. | |
$this->container->singleton( Module::class, Module::class ); |
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.
Why ? if the the 2 first arguments are the same this is completely unnecessary. The singleton method already does that.
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.
Passing as 2nd param loads it immediately.
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.
Nope, i dont see it :(
Should the hook to load the module should still be relevant after this change? |
🎫 Ticket
ETP-972
🗒️ Description
The commerce module should be initialized as early as possible in order for registrations that happen in the parent's construct to take place as early as possible as well.
This was a singleton already, so nothing should break by registering it asap.
🎥 Artifacts
No point for artifact really. The Module would be initialized whenever it was needed for the first time. Making calls to
Tribe__Tickets__Tickets::modules()
unstable and completely dependent on timing.✔️ Checklist
npm run changelog
to add changelog file(s). More info herewpunit
orintegration
tests.wpunit
orintegration
tests.