Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

$filename is set even when $data[$field.'_file_name'] or $data[$model…

…][$field.'_file_name'] is empty! so you better use !empty in this situation. it took me a really long time to figure out why the helper ignores the 'default_url' when the _file_name-field in the db is empty
  • Loading branch information...
commit 07ef24a57cf948c11d41ec7a045724f242aa7802 1 parent d500c3b
@roester roester authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  View/Helper/UploadHelper.php
2  View/Helper/UploadHelper.php
@@ -47,7 +47,7 @@ public function url($data, $field, $options = array())
- if(isset($id) && isset($filename))
+ if(isset($id) && !empty($filename))
$settings = UploadBehavior::interpolate($model, $id, $field, $filename, $options['style'], array('webroot' => ''));
$url = isset($settings['url']) ? $settings['url'] : $settings['path'];
Please sign in to comment.
Something went wrong with that request. Please try again.