client-php icon indicating copy to clipboard operation
client-php copied to clipboard

[Bug] Using Object Oriented Updates do not consider Custom Fields

Open cschra opened this issue 6 months ago • 4 comments

I have found that the Request Bodies don't consider the custom Fields. In my Opinion you should add the custom fields as property to the requests, so that when using the proper Object Oriented Syntax everything works as expected, because when I use an Array instead of the specific Class everything works. (but took me a while to debug this) Here is an example:

    $organization_request_body = new \Pipedrive\versions\v2\Model\OrganizationRequestBody(['custom_fields' => ['42[random]asl' => 'dummy', '57[random]asl' => 137]);
    $result = $apiInstance->updateOrganization($id, $organization_request_body);
    print_r($result); // -> success, but custom fields did not change

    $organization_request_body = ['custom_fields' => ['42[random]asl' => 'dummy', '57[random]asl' => 137]; //standard array
    $result = $apiInstance->updateOrganization($id, $organization_request_body);
    print_r($result); // -> success and custom fields did change

Kind regards, Christian

PS: Also it would make sense for me to return the updated Custom Fields in the response... (this would allow a validation/test...)

cschra avatar Jun 30 '25 09:06 cschra

Hello. @cschra please update to latest version

IgnorancePulls avatar Jul 07 '25 07:07 IgnorancePulls

Thanks for looking into it. However, after Updating from version 11.1 to 12.02, I get following error now:

   Error  Class "OneOfStringNumberMap" not found.

cschra avatar Jul 07 '25 10:07 cschra

Thanks for looking into it. However, after Updating from version 11.1 to 12.02, I get following error now:

Error Class "OneOfStringNumberMap" not found.

@IgnorancePulls could you please confirm this or is something wrong on my end?

cschra avatar Jul 08 '25 12:07 cschra

This issue has been marked as stale due to inactivity. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Dec 07 '25 07:12 github-actions[bot]