Skip to content

Commit

Permalink
Merge pull request #227 from n1215/fixGetUniqueFileName
Browse files Browse the repository at this point in the history
fixes #7581 メールフォームでファイルをアップロードするとエラーになることがある 問題を修正
  • Loading branch information
ryuring committed Dec 24, 2014
2 parents 9a6d209 + 5c7a571 commit 3f757d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Baser/Model/Behavior/BcUploadBehavior.php
Expand Up @@ -744,8 +744,8 @@ public function getUniqueFileName(Model $Model, $fieldName, $fileName, $setting

// 先頭が同じ名前のリストを取得し、後方プレフィックス付きのフィールド名を取得する
$conditions[$Model->name . '.' . $fieldName . ' LIKE'] = $basename . '%' . $ext;
$datas = $Model->find('all', array('conditions' => $conditions, 'fields' => array($fieldName), 'order' => $Model->name . '.name'));
$datas = Hash::extract($datas, '{n}.UploaderFile.name');
$datas = $Model->find('all', array('conditions' => $conditions, 'fields' => array($fieldName), 'order' => "{$Model->name}.{$fieldName}"));
$datas = Hash::extract($datas, "{n}.{$Model->name}.{$fieldName}");

if ($datas) {
foreach($datas as $data) {
Expand Down

0 comments on commit 3f757d7

Please sign in to comment.