Reading the existing data from the database works as expected but updating the field doesn’t.
In kirby2 we sent a comma separated list to the page’s update function but if I do that in kirby3 the writeContent function receives NULL.
I assume there is a check somewhere along the way that finds the format invalid. What would be the correct data to send to the update function?
I said everything works as expected however although this is true for my controller, which expects a comma separated list, it is not true for the panel. That complains of:
Access to non-existing property pages on array in file: /home/tick/Projects/athleticskillsplatform/kirby/src/Toolkit/Query.php line: 242
So apparently I have to read up on multiselect because that seems to have changed considerably.
The $video[‘category’] has the correct values but when it gets to writeContent the $data array has no value for category. So apparently it gets thrown out because of the bad configuration for the field.
Apparently there is something checking the field data when it gets updated. I had a similar problem with date fields where apparently the old datetime format didn’t get through the validation.
If you set the third parameter ($validate) to true, you should get an error when the page to update is not a draft (in case of draft status pages, no validation takes place).
The wrap your call in a try/catch block to catch errors.