Fix fatal error when fetching marketing campaigns for Marketing Channel #2423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
When loading the Marketing -> Overview section, there is a request to fetch the campaigns, but it currently fails because the campaign types are not loaded. The campaign types are only loaded if the filter
woocommerce_gla_enable_mcm
returns true.The fatal error is the below:
Screenshots:
This PR prevents the error by checking if the campaign types have been enabled before fetching the campaigns.
Detailed test instructions:
develop
.8 Refresh and see that now the campaigns are loaded.
Additional details:
Tests are failing because of this issue: #2415 (comment) however you can run the tests locally and see if everything is OK
Changelog entry