Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 9 tasks
daveherman71 opened this issue May 23, 2023 · 3 comments
Closed
2 of 9 tasks

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

daveherman71 opened this issue May 23, 2023 · 3 comments

Comments

@daveherman71
Copy link

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)

  • Build - Can’t install or import the SDK
  • Performance - Performance issues
  • Behaviour - Functions aren’t working as expected (such as generate URL)
  • Documentation - Inconsistency between the docs and behaviour
  • Other (Specify)

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

  • Linux
  • Windows
  • macOS
  • All

Environment and Frameworks (fill in the version numbers)

  • PHP Cloudinary SDK version - 2.10.2
  • PHP Version - 8.0.28
  • Framework (CodeIgniter) - 3.1.13

Repository

N/A

@camohub
Copy link

camohub commented May 23, 2023

The same problem today here.
PHP 7.4
Coudinary ^2.1

@PixelCook
Copy link
Collaborator

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
Copy link
Contributor

Fixed in #385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants