Set update plugins transient to object instead of null#622
Merged
Crabcyborg merged 1 commit intoNov 12, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #622 +/- ##
============================================
- Coverage 27.40% 27.40% -0.01%
Complexity 6292 6292
============================================
Files 90 90
Lines 17364 17370 +6
============================================
+ Hits 4759 4760 +1
- Misses 12605 12610 +5
Continue to review full report at Codecov.
|
stephywells
approved these changes
Nov 12, 2021
Contributor
stephywells
left a comment
There was a problem hiding this comment.
Nice find! Weird that WooCommerce has this issue when it would conflict with so many plugins. I'm seeing the "null" all over the place when I do a Google search...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I don't really know how to run this directly, this is pretty deep in EDD code, but I believe this shouldn't have any issues.
Related to https://secure.helpscout.net/conversation/1694625984/85305?folderId=4324209
If I have woocommerce installed and I run the following snippet:
However this snippet:
Runs just fine.
In woocommerce, in WC_Helper_Updater::transient_update_plugins it has this line:
There are also a few lines above that could be problematic as well:
It really expects that the transient is an object. This is really more of a bug with woocommerce expecting data that could definitely be something else, but it's something we can fix on our end.
I borrowed most of this code from WordPress, see https://developer.wordpress.org/reference/functions/wp_update_plugins/