When I can add new image by REST API (as update by PUT method) new image into the existing array of imageges there is no possibility to combine "base64 data" and "fid reference to just stored image" , see:
[ "data:image/jpeg;base64,<base64>", {"fid": "<number>"}, ... ]
PUT of this json code will create log entry:
Warning: preg_split() expects parameter 2 to be string, object given in function restws_file_create_files() (line: 119 in file /home/domains/aaaakce.cz/node0/domain_home/www/sites/all/modules/restws_file/restws_file.module).
It means so, {"fid": "<number>"} produce non-string value ;)
It can be imply resolve by adding this code on line 119 (see attached patch):
if (!is_string($enc_contents_item)) {
array_push($fid_array, $enc_contents_item);
continue;
}
Comments
Comment #2
marek.veber commentedComment #3
marek.veber commentedComment #4
mariano.barcia commented@marek.veber, thank you for pointing this out AND providing a patch!
It looks very good.
As soon as I find the time during the holidays I'll test it and hopefully issue a new release.
Cheers,
--mariano
Comment #6
mariano.barcia commentedAdded in the new release 1.1. @marek.veber I've given you proper credit for this, thank you very much.