FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Save on _joinData #568

Closed tgoeminne closed 2 years ago

tgoeminne commented 3 years ago

Hi,

the attachment does not get saved on _joinData

$this->Articles->patchEntity($article, $data,['associated' => ['Attributes._joinData.ArticleAttributeAttachments']]);

I can see the attachment is there when I print.

[attachment] => Array ( [tmp_name] => xxxxxxxxxxx [error] => 0 [name] => image.png [type] => image/png [size] => 203159 )

Then after save, the same array is still there and it did not get saved. When normally it gets replaced with the attachment data after the save. Is it because of the _joinData ?

It is also not throwing any errors... just not saving the image to the database or server.

davidyell commented 3 years ago

Sounds like the column might not be set as an image upload in the schema to me

Or that you have not configured the behaviour to match the field name

tgoeminne commented 3 years ago

the behaviour works when i save it separate, so there are no naming problems. When saved as joinData - hasmany it doesnt work.