BobRay / UpgradeMODX

A dashboard widget that detects upgrades and (optionally) installs them from within the MODX Manager
https://bobsguides.com/upgrade-modx-package.html
22 stars 14 forks source link

Error due to old version of GuzzleHttp #75

Open Prihod opened 2 years ago

Prihod commented 2 years ago

The component uses an old version of GuzzleHttp which results in a "Fatal error: Uncaught Error: Undefined class constant 'MAJOR_VERSION' in" error if another component uses a newer version of GuzzleHttp

BobRay commented 2 years ago

Thanks for the heads up. Some questions:

  1. Can you tell me what file and line the MAJOR_VERSION error occurs on (or at least whether it's in Guzzle, UpgradeMODX, or somewhere else).
  2. Do you happen to know what other extra has the newer version of Guzzle?
  3. Do you have a way to try updating the UpgradeMODX Guzzle version with composer?
Prihod commented 2 years ago

1) Fatal error: Uncaught Error: Undefined class constant 'MAJOR_VERSION' in /www/wwwroot/site.com/core/components/my/vendor/guzzlehttp/guzzle/src/Utils.php:113 Stack trace: #0 /www/wwwroot/site.com/core/components/polylang/vendor/guzzlehttp/guzzle/src/functions.php(71): GuzzleHttp\Utils::defaultUserAgent() #1 /www/wwwroot/site.com/core/components/upgrademodx/vendor/guzzlehttp/guzzle/src/Client.php(194): GuzzleHttp\default_user_agent() #2 /www/wwwroot/site.com/core/components/upgrademodx/vendor/guzzlehttp/guzzle/src/Client.php(75): GuzzleHttp\Client->configureDefaults() #3 /www/wwwroot/site.com/core/components/upgrademodx/model/upgrademodx/upgrademodx.class.php(189): GuzzleHttp\Client->__construct() #4 /www/wwwroot/site.com/core/cache/includes/elements/modsnippet/19.include.cache.php(75): UpgradeMODX->init() #5 /www/wwwroot/site.com/core/model/modx/modscript.class.php(76): include('/www/wwwroot/de...') #6 /www/wwwroot/site.com/core/model/modx/moddas in /www/wwwroot/site.com/core/components/polylang/vendor/guzzlehttp/guzzle/src/Utils.php on line 113

  1. No
  2. No
BobRay commented 2 years ago

Thanks! It looks like GuzzleHttp doesn't much care about backward compatibility. This would have been really easy for them to avoid, imo.

BobRay commented 2 years ago

One more question, you're on MODX 2, right?

Prihod commented 2 years ago

Yes