-
Notifications
You must be signed in to change notification settings - Fork 427
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
Force-autoloading class-tgm-plugin-activation.php
breaks my plugin's tests because its code doesn't account for WordPress not yet loaded
#792
Comments
class-tgm-plugin-activation.php
breaks my plugin's testsclass-tgm-plugin-activation.php
breaks my plugin's tests because its code doesn't account for WordPress not yet loaded
@cliffordp I'm not sure I understand the problem. The file does contain defensive coding for If |
Only thing I can think of is that that code may not be in the last release. It is in the file in |
I've got v2.6.1 as confirmed by PhpStorm in this screenshot, which is the latest version from https://packagist.org/packages/tgmpa/tgm-plugin-activation I see neither v2.6.1 nor master have the ABSPATH check that's present in develop. Adding that check from develop does fix the issue with my tests. Sounds like a version bump would be the path forward. Thanks for the quick help! :) |
@jrfnl any idea why https://packagist.org/packages/tgmpa/tgm-plugin-activation has v2.6.1 as latest version still - no version bump yet? Using |
@cliffordp Because that is the latest version. See my previous answer to you about releasing a new version: #741 (comment) Also, you can see exactly what has changed between the last release and |
I understand. How can we get 2.6.2 (or whatever other number, such as 2.6.1.1) released that ONLY has the defensive coding for |
See my previous answer and no, that will not be a release just with that fix. |
boo 😜 thanks for the quick, thorough help nonetheless. appreciate ya! |
One workaround is to use the git repository: "repositories": [
{
"type": "package",
"package": {
"name": "tgm/plugin-activation",
"version": "2.6.1",
"source": {
"url": "https://github.com/TGMPA/TGM-Plugin-Activation.git",
"type": "git",
"reference": "master"
}
}
}
], And then require the latest: "require": {
"tgmpa/tgm-plugin-activation": "*",
}, |
Or, you could define dependency on |
Re: https://github.com/TGMPA/TGM-Plugin-Activation/blob/develop/composer.json#L36-L38
Force-loading this file causes errors when running Codeception tests on a plugin that implements TGMPA, failing because
class-tgm-plugin-activation.php
does not have defensive code ifdid_action
function exists or ifABSPATH
is not defined.Screenshot:
If ☝️ gets fixed, that's when the
ABSPATH
one appears. This has to be fixed in the package because TGMPA is installed via Composer.I'd be willing to submit a PR but am unsure if it'd be received/implemented.
I had bookmarked checking out https://github.com/afragen/wp-dependency-installer anyway so that's what I'm going to try next.
The text was updated successfully, but these errors were encountered: