Call to undefined function "default_user_agrnt" Drupal 9.3.11 upgrade via composer. I had to comment out the following in ClientFactory.php. It appears functions have been depeciated in Guzzle. See https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md at version 7.1.0 2020-09-22 "All functions in GuzzleHttp has been deprecated. Use static methods on Utils instead."
I have a library which needed Guzzle greater than 7.2 to fix a bug and installed 7.4 in a private vendor directory but apparent Drupal sees it - and maybe uses it ??
. . . .
'timeout' => 30,
// 'headers' => [
// 'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . \GuzzleHttp\default_user_agent(),
// ],
'handler' => $this->stack,
. . . . .
I realize this Guzzle uprade to 7 is supposed to be in Drupal 10 => see https://www.drupal.org/project/drupal/issues/3104353 but this is causing a bug right now that takes down the site unless you know what to do. The user agent is not required
Comments
Comment #2
cilefen commentedPlease show us the composer.json file.
Comment #3
cilefen commentedAlso please get a call stack because we have no idea what’s calling that function otherwise.
Comment #4
cilefen commentedComment #5
bobburns commentedThis is for the Amazon library "ten7/amazon-paapi5-php-sdk": "^1.0@alpha",
There was a Guzzle PSR bug fixed 7.2, so changing the composer.json in the library directory to greater than 7.2 and running composer update in that directory places the vendor directory dependencies directly in the library - no /vendor directory. It install Guzzle 7.4 Here is the composer.json
I do not know how to get a call stack trace
Comment #6
cilefen commentedYou configure that in the "Logging and errors" admin page.
Comment #7
bobburns commentedI have unistalled and removed the amazon modules because in part Amazon broke its own useful code with throttling and the code also conflicts with Drupal Rector stating class conflicts. You can reproduce this by installing Guzzle greater than 7.2 through a composer .json in a directory or library and then the error will likely appear and you can stack trace it.
Since Drupal is currently still on an old version of Guzzle locked to version 6 - the issue it seems is that Guzzle has removed the function from its current code and the ClientFactory.php file needs revision. To solve it - move to guzzle greater than 7.2 - which fixes two known Guzzle/Psr bugs also.
Currently even Drupal Rector has managed to break itself and so Drupal is dead in the water again right now because no one user can humanly keep up with the depreciations going on and have Drupal be useful. See https://www.drupal.org/project/rector/issues/3275937 - but alas - Drupal 7 still works and anyone with a site they need to be reliable alwys keeps it in a directory ready to switch back to.
Comment #8
cilefen commented