-
Notifications
You must be signed in to change notification settings - Fork 25
Fix: (one of) fatal error "No entry was found for 'comingSoon'" #929
Conversation
6 failed and 1 flaky tests on run #6830 ↗︎Details:
|
Test | Artifacts | |
---|---|---|
Coming Soon > Launching launches site |
Test Replay
Screenshots
Video
|
vendor/newfold-labs/wp-module-ecommerce/tests/cypress/integration/Home/commerceHomePage.cy.js • 1 failed test
Test | Artifacts | |
---|---|---|
Commerce Home Page- Live Mode > Verify presense of Ready to go to next level? canvas |
Test Replay
Screenshots
Video
|
vendor/newfold-labs/wp-module-ecommerce/tests/cypress/integration/Store/storePage.cy.js • 1 failed test
Test | Artifacts | |
---|---|---|
Store Page- WooCommerce is deactivated/uninstalled > Verify Store and its sub tabs should have Install WooCommerce buttons |
Test Replay
Screenshots
Video
|
vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/3-ecommerce-onboarding-flow/basic-info.cy.js • 3 failed tests
tests/cypress/integration/help.cy.js • 1 flaky test
Test | Artifacts | |
---|---|---|
Help Page > Is Accessible |
Test Replay
Screenshots
Video
|
Review all test suite changes for PR #929 ↗︎
@@ -175,7 +175,7 @@ public function get_current_settings() { | |||
} | |||
|
|||
$settings = array( | |||
'comingSoon' => container()->get( 'comingSoon' )->is_enabled(), | |||
'comingSoon' => container()->has( 'comingSoon' ), |
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 changes the meaning behind the comingSoon
property. The has()
check just looks to see if the service is registered in the container. We should look into why the coming soon service doesn't exist yet and fix 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.
Yeah, I wrote that first then realised there was more going on than i quite understood.
The lower case The uppercase part is the coming soon service that is added to the container. It's set up here: https://github.com/newfold-labs/wp-module-coming-soon/blob/main/includes/API/ComingSoon.php#L37 Here it's an object which exposes the enable and disable methods. Perhaps we're beating ourselves and the SettingsController loads before the modules have loaded and set up |
@circlecube I'm not sure what might have changed, as I tested this, and it worked fine before. But yes, my guess is that the code is triggering before the container is fully set up. |
We discussed this recently and it is no longer needed. |
Recent commit 70f155c queries the container for
comingSoon
and calls methodsis_enabled()
,enable()
anddisable()
on the result.But where it is added to the container is
comingsoon
notcomingSoon
.bluehost-wordpress-plugin/bootstrap.php
Lines 63 to 95 in f51c559
When I change it to use
comingSoon
in both places, the container returns the array that has been registered, but then the code attempts to call theis_enabeld()
method which does not exist.Proposed changes
This PR changes
container()->get( 'comingSoon' )->is_enabled()
tocontainer()->has( 'comingSoon' )
.Type of Change
Checklist
Further comments
Where
enable()
anddisable()
are called will still cause a crash.The Coming Soon module itself uses lowercase
$container->has( 'comingsoon' )
at includes/ComingSoon.php:46I don't see a class with those methods so I'm not sure exactly how this should be working.