josegonzalez/upload — Issue #37: beforesave not working for multiple files
Author: diverdude
Created: 2011-12-21 17:34:06+00:00
State: open

With more than one file, hitting beforesave with this $model->data:
Array
(
[Image] => Array
(
[0] => Array
(
[filename] => Array
(
[name] => Family-Guy.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php3lEg2Q
[error] => 0
[size] => 56044
)

)

[1] => Array
(
[filename] => Array
(
[name] => Homer_Simpson.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpC2tDtp
[error] => 0
[size] => 26379
)

)

)

)

makes this line:
if (!isset($model->data[$model->alias][$field])) continue;
fail and hit continue, so which means the remaining of beforesave is not executed and nothing is inserted in db