malhal / CloudKit-PHP

For server-to-server comms from PHP to CloudKit.
MIT License
39 stars 10 forks source link

Error on saveRecords #5

Open Giorgoulakis opened 7 years ago

Giorgoulakis commented 7 years ago

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 ?

swiftjsoneditor commented 6 years ago

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

swiftjsoneditor commented 6 years ago

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