Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

[Bug] Cannot create a Glossary after deleting another one #43

Open
MolloKhan opened this issue May 12, 2022 · 2 comments
Open

[Bug] Cannot create a Glossary after deleting another one #43

MolloKhan opened this issue May 12, 2022 · 2 comments

Comments

@MolloKhan
Copy link

Hi, I just found a bug when trying to create a custom "update" operation for my glossaries. Since the API does not support an update operation what I did as a workaround was to delete first the Glossary and then recreate it with the new entries list.
The problem is that this library has a bug when you make a POST request after a DELETE request, I get the error The Response seems to not be valid JSON.

The BabyMarkt\DeepL\Client needs a way to reset its $curl property after any of those requests. I added these lines just before handling the response and it suddenly worked

        if ($this->curl && is_resource($this->curl)) {
            curl_close($this->curl);
        }

        $this->curl = curl_init();
        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
@VimS
Copy link
Collaborator

VimS commented May 19, 2022

Could you create a pull request please?
Without a sample-usage it is difficult to tell where the Bug is.

@MolloKhan
Copy link
Author

MolloKhan commented May 20, 2022

I just did here #44

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

No branches or pull requests

2 participants