docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 123 forks source link

Call to a member function read() on string in ObjectSerializer.php:285 #102

Closed BelloAM closed 4 years ago

BelloAM commented 4 years ago

I get this error whenever i run the EnvelopeApi\getDocument method. It seems that the $data being passed to the deserialize function is a string.

I managed to get it to work by changing line 285-287 to

if(is_string($data)){
    fwrite($file, $data);
}
else{
    while ($chunk = $data->read(200)) {
        fwrite($file, $chunk);
    } 
}

Unfortunately; this change is always removed when we deploy to our servers

LarryKlugerDS commented 4 years ago

Thank you @BelloAM for this problem report. I have filed bug report DCM-4285

LarryKlugerDS commented 4 years ago

Note that the EnvelopeApi\getDocument method should be updated to not write to a local file. See issue #56

fdiedler commented 4 years ago

Hi, I have the same problem since one week. When this bug will be fixed ? Thanks

LarryKlugerDS commented 4 years ago

Unfortunately we don't yet have a fix scheduled from the engineering group. I have asked them again.

fdiedler commented 4 years ago

I am very embarrassed with this bug, we cannot retrieve contract file anymore and it blocks the onboarding of new clients in my company... Please correct it as soon as possible and thanks for asking them again about this bug. I think I am not the only people affected :)

Otherwise, It is possible to downgrade to a prior version without the bug ? And if so, which version ?

Thanks, and looking forward the fix

NB: I cannot use a quick and dirty fix because when I deploy my application on production, the fix will be removed as @BelloAM said.

LarryKlugerDS commented 4 years ago

I am sorry that this is causing a problem for you. The prior releases of the SDK are available from GitHub. They are also available from the PHP Packagist site.

fdiedler commented 4 years ago

Aie, I think I cannot downgrade because I use a wrapper : tucker-eric/docusign-rest-client

So, I just removed the code that calls getDocument() method and I will wait for a fix and hope it will be soon :)

Thanks,

wehostadm commented 4 years ago

Hi,

Just to say that I am also waiting for a fix for this bug as soon as possible. It will be a shame and a waste of time if I need to recode the function getDocument()

Maybe use the quick fix of @BelloAM above and then do a better fix if needed ?

Thanks a lot for this DocuSign bundle.

LarryKlugerDS commented 4 years ago

I've escalated the bug, but we don't yet have a schedule for the fix.

cgsmith commented 4 years ago

Hi @LarryKlugerDS

Are pull requests welcomed for this? An option could be passed through to save contents to a variable.

LarryKlugerDS commented 4 years ago

Hi @cgsmith , Re: pull requests -- thank you for asking!

We use a customized version of the Swagger CodeGen app to create all of the SDKs. We're working on open sourcing our customizations.

Today: if you make a pull request then our engineering team can use your ideas to change the underlying models used to produce the SDK.

In the future: you'll be able to directly propose a PR that would change the model that would change the SDK.

Regards, Larry

LarryKlugerDS commented 4 years ago

Good news: the engineering group reports that this issue has been fixed n the RC release 5.3.0-RC.

If you can, please test the release candidate to check that the fix works for you. Thank you.

The 5.3.0-RC (release candidate):

The PRs:

https://github.com/docusign/docusign-php-client/pull/108 https://github.com/docusign/docusign-php-client/pull/109

LarryKlugerDS commented 4 years ago

No reply for 10 days. Closing. Please comment to re-open if there's still an issue. Thank you, Larry