Comments (20)
I don't know if Zendesk is willing to merge this.. A quick & MacGyver solution, instead of modifying the core files. Create a directory in your project
GuzzleHttp/psr
And paste in the code below
<?php
# functions.php
namespace GuzzleHttp\Psr7;
/**
*
* @param string $resource
* @param array $options
*
* @return PumpStream|Stream|\Psr\Http\Message\StreamInterface
*/
function stream_for($resource = '', array $options = [])
{
return Utils::streamFor($resource, $options);
}
from zendesk_api_client_php.
Merge please @zendesk 😇
from zendesk_api_client_php.
Do you folks need a cross-compatible version of the fix that would comply with multiple versions of Guzzle, maybe?
At least 3 unmerged PRs:
A cross-compatible version should be easy, a simple if (function_exists(...))
should do the trick.
I would've created a PR, but since there's lots of them already, I didn't want to pollute the current state of the project.
However, I'm one of the several people whose production broke because of this, and I had to use a dirty quickfix for that which I don't like at all, so as others, I wish this could be fixed and released soon 😉
from zendesk_api_client_php.
Can you release a new version that allows guzzle psr7 v2 to be installed?
from zendesk_api_client_php.
As it might be helpful to some - I didn't want to mess with my directory structure, thus I've saved @kevinirlen into a file within my usual workspace (called functions.php) and used composer to autoload this file:
composer.json:
"autoload": { "classmap": [ "database", "app/Libraries" ], "psr-4": { "myNamespace\\": "app/" }, "files": [ **"app/Libraries/Internal/Fixes/Psr7/functions.php"** ] },
from zendesk_api_client_php.
@thekindofme, @gkatechis, @gmponos, @nogates sorry to ping you guys but would it be possible to merge one of the fixes (like #469)? The requirement is not correct and it's easy to mess-up.
The current workaround is to add a function like @kevinirlen proposes or to require explicitly and old version of guzzlehttp/psr7
(composer req "guzzlehttp/psr7:^1"
).
Thanks in advance
from zendesk_api_client_php.
For those following this, it looks like it will have been resolved as #469 has been merged, and these changes are included in release v2.2.12
from zendesk_api_client_php.
Huge problem, this just occurred on production for me. A workaround is to do what @simonmaass mentioned.
from zendesk_api_client_php.
from zendesk_api_client_php.
this is also fixed via #469
we'd love to get one of these solutions merged ASAP if at all possible.
from zendesk_api_client_php.
Quickfix: Goto: \vendor\zendesk\zendesk_api_client_php\src\Zendesk\API\HTTP.php Line 70 and replace
//Corrected cause of error
$request = $request->withBody(\GuzzleHttp\Psr7\Utils::streamFor(json_encode($options['postFields'])));
//Original code
//$request = $request->withBody(\GuzzleHttp\Psr7\stream_for(json_encode($options['postFields'])));
from zendesk_api_client_php.
#471 and #472 would be a perfect response.
This problem is major because any update cause a fault as soon as guzzle is updated to a recent version.
Thanks for your help !
from zendesk_api_client_php.
if you want backward compatibility with guzzle 6.x... then i think the cleanest solution for now would be to require "guzzlehttp/psr7": "^1.8.3",
in the composer.json for this project... at least a clean composer install would not break anymore...
@thekindofme ping
from zendesk_api_client_php.
Any news on a timeframe for a merge?
Thanks for posting the workarounds guys
from zendesk_api_client_php.
It seems that packagist is not updated automatically, the last ^v2 is still v2.2.11 (https://packagist.org/packages/zendesk/zendesk_api_client_php). You can use "dev-master" or the specific commit as a workaround.
from zendesk_api_client_php.
dev-master actually doesn't work directly as it isn't updated on packagist as well. You'll have to add this repository in your composer.json before being able to pull for dev-master or v2.2.11
from zendesk_api_client_php.
You are right
from zendesk_api_client_php.
It looks like it is on packagist now.
from zendesk_api_client_php.
I have guzzlehttp/psr7:2.1
dependency in my project (from auth0/auth0-php:^8
). So in my case the last version I'm able to install is 2.2.11
that has this issue 😒
from zendesk_api_client_php.
Related Issues (20)
- \Zendesk\API\Resources\Core\Search::find has wrong parameter type annotation HOT 2
- Security issue in oauth sample HOT 1
- Array to string conversion error HOT 6
- PHP8 Error: array_merge() does not accept unknown named parameters HOT 1
- php 5.6 Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/clients/client1/web6/web/vendor/guzzlehttp/guzzle/src/HandlerStack.php on line 47 HOT 1
- Update Packagist with the new version HOT 3
- Unmerged PRs HOT 3
- Okta HOT 2
- Oktane22
- Add comment to ticket HOT 3
- FindAll method Ambiguity in Error Webhooks HOT 3
- No events API support? HOT 2
- Type error: Argument 1 passed to GuzzleHttp\Client::send()
- Allow any PSR-17 and PSR-18 implementation to be used
- How to get the latest tickets created by a customer? HOT 2
- webhook count support not available ? HOT 1
- Repository maintenance status HOT 14
- Problem with updates of users HOT 2
- tickets createMany method implementation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zendesk_api_client_php.