UpgradeMODX icon indicating copy to clipboard operation
UpgradeMODX copied to clipboard

Error due to old version of GuzzleHttp

Open Prihod opened this issue 3 years ago • 5 comments

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

Prihod avatar May 17 '22 20:05 Prihod

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?

BobRay avatar May 18 '22 02:05 BobRay

  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

Prihod avatar May 18 '22 05:05 Prihod

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

BobRay avatar May 18 '22 05:05 BobRay

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

BobRay avatar May 18 '22 05:05 BobRay

Yes

Prihod avatar May 18 '22 05:05 Prihod