malhal / CloudKit-PHP

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

Numeric values in fields #7

Open swiftjsoneditor opened 7 years ago

swiftjsoneditor commented 7 years ago

Hello,

I am having issues with updating / creating integer values Int64

I am sending the field update as

$record->setField('isFirstTime', 1);

however the request fails with BadRequestException: Unexpected input

Any clue?

Thanks

malhal commented 7 years ago

In Record.php line 139 you could try something else for the type. I think they might have changed it, I think they were mentioned here

swiftjsoneditor commented 7 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.

inPhilly commented 7 years ago

I think commenting line 151 keeps a number from being set! What should the actual fix for this issue be???

malhal commented 7 years ago

erm...maybe he meant:

$fields[$key] = ['value' => $fv];

i.e. removing the type from the array