Skip to content
Snippets Groups Projects
Commit 7c7065f5 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#323438 by emok, chx, mfb: uploaded files become arrays in previews, so object...

#323438 by emok, chx, mfb: uploaded files become arrays in previews, so object property checking will not work on them (from PHP 5.2.12+)
parent 20e829db
No related branches found
No related tags found
No related merge requests found
......@@ -189,6 +189,9 @@ function upload_node_form_submit(&$form, &$form_state) {
if (isset($form_state['values']['files'])) {
foreach ($form_state['values']['files'] as $fid => $file) {
// If the node was previewed prior to saving, $form['#node']->files[$fid]
// is an array instead of an object. Convert file to object for compatibility.
$form['#node']->files[$fid] = (object) $form['#node']->files[$fid];
$form_state['values']['files'][$fid]['new'] = !empty($form['#node']->files[$fid]->new);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment