cloudinary / cloudinary_php

PHP extension for Cloudinary
https://cloudinary.com/documentation/php_integration
MIT License
389 stars 150 forks source link

Call to undefined function GuzzleHttp\Promise\promise_for() #384

Closed daveherman71 closed 1 year ago

daveherman71 commented 1 year ago

Bug report for Cloudinary PHP SDK

Using cloudinary/cloudinary_php version 2.10.2 The latest version of Guzzle Promises was released on 21 May 2023 and was downloaded automatically as a dependency.

Describe the bug in a sentence or two.

After upgrading GuzzleHTTP via Composer the BaseAPIClient and ApiClient classes throw errors because of the removal of the GuzzleHTTP function API that was previously deprecated.

BaseAPIClient and APIClient use two functions that have now been removed from Guzzle Promises and these need to be updated.

Promise\promise_for() replaced with Promise\Create::promiseFor() Promise\rejection_for() replaced with Promise\Create::rejectionFor()

This has been clearly outlined here: https://github.com/guzzle/promises#upgrading-from-function-api

Issue Type (Can be multiple)

BUG: The entire package no longer works and multiple exceptions are thrown.

Steps to reproduce

Load the package and attempt to use any of the API calls.

Error screenshots or Stack Trace (if applicable)

An uncaught Exception was encountered

Type: Error

Message: Call to undefined function GuzzleHttp\Promise\promise_for()

Filename: C:\inetpub\wwwroot\demo\vendor\cloudinary\cloudinary_php\src\Api\BaseApiClient.php

Line Number: 333

Backtrace:

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 209
Function: Cloudinary\Api\{closure}

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 158
Function: callHandler

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\TaskQueue.php
Line: 52
Function: GuzzleHttp\Promise\{closure}

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php
Line: 159
Function: run

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php
Line: 185
Function: tick

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 251
Function: execute

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 227
Function: invokeWaitFn

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 272
Function: waitIfPending

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 229
Function: invokeWaitList

File: C:\inetpub\wwwroot\demo\vendor\guzzlehttp\promises\src\Promise.php
Line: 69
Function: waitIfPending

File: C:\inetpub\wwwroot\demo\vendor\cloudinary\cloudinary_php\src\Api\SearchApi.php
Line: 248
Function: wait 

Operating System

Environment and Frameworks (fill in the version numbers)

Repository

N/A

camohub commented 1 year ago

The same problem today here. PHP 7.4 Coudinary ^2.1

PixelCook commented 1 year ago

Thanks for bringing this up, we are looking into the issue and will update you soon. In the meantime please use the previous version.

Thanks!

const-cloudinary commented 1 year ago

Fixed in #385