CloudKit-PHP icon indicating copy to clipboard operation
CloudKit-PHP copied to clipboard

Error on saveRecords

Open Giorgoulakis opened this issue 9 years ago • 2 comments

Great work !!! In my case with the same code on saveRecords raise an error :

` object(CloudKit\CKError)#6 (5) { ["serverErrorCode":"CloudKit\CKError":private]=> string(11) "BAD_REQUEST" ["reason":"CloudKit\CKError":private]=> string(37) "BadRequestException: Unexpected input" ["recordName":"CloudKit\CKError":private]=> NULL ["uuid":"CloudKit\CKError":private]=> string(36) "1b64e7d3-27fe-4489-8589-123369ca6d20" ["retryAfter":"CloudKit\CKError":private]=> NULL } Success

` my code :

` $record = new Record('test'); $record->setField('company', 1000); $record->setField('branch', 1001); $record->setField('user', 1234); $response2 = $container->getPublicCloudDatabase()->saveRecords([$record]); if($response2->hasErrors()) { var_dump($response2->getErrors()[0]); }else{ echo "Success\n"; }

`

Any idea ?

Giorgoulakis avatar Dec 23 '16 16:12 Giorgoulakis

I have the same issue, it is when the field is numeric value any idea?

swiftjsoneditor avatar Aug 06 '17 01:08 swiftjsoneditor

I figured it out, commenting line 151 in Record.php does the work as it looks like the type is no more needed.

swiftjsoneditor avatar Aug 07 '17 18:08 swiftjsoneditor