Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
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

Description

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions