davidpersson/media — Issue #71: Issue saving record without attached image
Author: kro12
Created: 2012-02-23 10:54:12+00:00
State: open

Hi, thanks for a great plugin.
I am saving a Rate record and an associated image . Everything works fine when an image is added, when an image isn't added the Rate record gets corrupted.

The array is as follows:

Array ( [Rate] => Array ( [enabled] => 0 [is_corporate] => 0 [special_offer] => 0 [list_no] => 0 [id_ref] => 43564566 [title] => rate7 [price_quote_as] => 0 [adult_supplement] => 0 [child_supplement] => 0 [supplement] => 0 [short_description] => rate7 [description] =>

rate7 [available] => Array ( [0] => 2 ) [minimum_stay] => 0 [maximum_stay] => 0 [valid_from] => 2012-02-24 [valid_to] => 2012-02-25 [file] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) ) [Room] => Array ( [Room] => Array ( [0] => 16 ) ) )

Note the 'file' array with the error 4.

When I remove the 'Media.Coupler' from the model the Rate record is written correctly but the image data is lost.
Regards,
Kro