pipedrive / client-php

Pipedrive API client for PHP
MIT License
48 stars 55 forks source link

DealFieldsApi->getDealFields() fails with error 'Class 'FieldTypeAsString' not found' #91

Closed FrederikHulleman closed 10 months ago

FrederikHulleman commented 1 year ago

Hi everyone,

I'm running pipedrive/pipedrive:5@beta and when using the getDealFields function on DealFieldsApi, it fails with 'Class 'FieldTypeAsString' not found'. My code is added below.

Other endpoints like POST deals is working perfectly.

Who has an idea what goes wrong?

        $apiKey = Environment::getEnv('PIPEDRIVE_API_KEY');
        $companyDomain = Environment::getEnv('PIPEDRIVE_COMPANY_DOMAIN');

        $host = str_replace('{{companyDomain}}', $companyDomain, 'https://{{companyDomain}}.pipedrive.com/v1');

        $this->configuration = (new Pipedrive\Configuration())
            ->setApiKey('api_token', $apiKey)
            ->setHost($host);

       $apiInstance = new Pipedrive\Api\DealFieldsApi(
            new GuzzleHttp\Client(),
            $this->configuration
        );

        try {
            $result = $apiInstance->getDealFields(0, 10);
            print_r($result);
        } catch (\Exception $e) {
            print_r('Exception when calling DealFieldsApi->getDealFields: ' . $e->getMessage());
        } 
chrisTrung commented 1 year ago

I get this problem too.

bashmach commented 1 year ago

Hi,

Thank you for reporting the issue.

Version 6.1.0 has been just released with the fix.

chrisTrung commented 1 year ago

Does this also fix that jsonserializer will return "mixed" when this is not supported in php 7.4?

bashmach commented 1 year ago

@chrisTrung No, 6.1 doesn't include a fix for the issue.

We will try to look into the problem and get back with an update there in the issue. But FYI, since 7.4 version had the end of life already in November 2022, we're considering dropping its support.

bashmach commented 10 months ago

Closing due to no recent activity. If you are running into a similar problem, feel free to create a new GitHub issue.

Thank you.