Closed khalwat closed 3 months ago
Thanks @khalwat – For now I've removed the deprecator log, just leaving the @deprecated
comment.
I don't know where else to report this…
I've enabled issues on https://github.com/craftcms/cloud-extension-yii2 and we will update issue templates to direct there.
and there is no CHANGELOG.md to see the changes from version to version, which can be helpful
For now, release notes is the best place to find that info, but that will likely change once Cloud in in GA.
Finally, the documentation still says to use isCraftCloud and should probably be updated.
Done!
What happened?
Description
This change adds a deprecator to the
isCraftCloud
global, which on the surface makes sense, since you're moving it elsewhere.The problem is that the function is accessed immediately whenever the Twig environment is initialized:
...which then invokes the deprecator:
So you're going to get a deprecation notice every time, whether your templates or other code ever access the
isCraftCloud
global variable.This is relatively minor (although incorrect/unintended), except that if you have this in your
config/app.php
:...and in that case, any time anything uses Twig, it's going to throw an exception. The only recourse is to uninstall the
craftcms/cloud
package, or disabledeprecator.throwExceptions
Sidenote:
I don't know where else to report this, because if I click the link here on GitHub to report an issue for Craft Cloud, I'm sent to a generic contact form which doesn't seem appropriate for a technical issue specifically with the
cloud-extension-yii2
(but maybe it is?)Also, the
craftcms/cloud
extension is oddly aliased to thecraftcms/cloud-extension-yii2
, and neither of them has an Issues tab enabled, so I can't submit an issue there either (and there is noCHANGELOG.md
to see the changes from version to version, which can be helpful).Finally, the documentation still says to use
isCraftCloud
and should probably be updated.Steps to reproduce
craftcms/cloud
installedisCraftCloud
Twig global is accessed from any templatesWorser:
craftcms/cloud
installeddeprecator.throwExceptions
=true
Expected behavior
Deprecation notices/exceptions would only be logged/thrown when the global is actually accessed.
Actual behavior
Deprecation notices/exceptions are logged/thrown on every request, regardless of whether
isCraftCloud
is accessed from a Twig template.Craft CMS version
4.x, 5.x
PHP version
n/a
Operating system and version
n/a
Database type and version
n/a
Image driver and version
n/a
Installed plugins and versions
craftcms/cloud