Closed leungpeng closed 11 years ago
I found that if the transforms array element contains key, there will be some warning during upload. The problem is that keySet in transforms may not equal to '$transportedFiles' keySet.
Problem( line 289 in AttachmentBehavior.php):
$dbColumn = $attachment['transforms'][($i - 1)]['dbColumn'];
Example: Original:
public $actsAs = array( 'Uploader.Attachment' => array( 'file' => array( ... 'transforms' => array( 'small'=>array( 'method' => 'resize', 'append' => '-small', 'width' => 160, 'height' => 120, 'aspect' => false, 'dbColumn' => 'small', ), 'med'=>array( 'method' => 'resize', 'append' => '-medium', 'width' => 640, 'height' => 480, 'aspect' => false, 'dbColumn' => 'med', ), ), 'transport' => array( 'class' => 's3', .... ) ) ), )
Finally,(work without warning)
public $actsAs = array( 'Uploader.Attachment' => array( 'file' => array( ... 'transforms' => array( array( 'method' => 'resize', 'append' => '-small', 'width' => 160, 'height' => 120, 'aspect' => false, 'dbColumn' => 'small', ), array( 'method' => 'resize', 'append' => '-medium', 'width' => 640, 'height' => 480, 'aspect' => false, 'dbColumn' => 'med', ), ), 'transport' => array( 'class' => 's3', .... ) ) ), )
Weird, I thought I fixed this before. Will fix ASAP.
Fixed in 4.0.4
I found that if the transforms array element contains key, there will be some warning during upload. The problem is that keySet in transforms may not equal to '$transportedFiles' keySet.
Problem( line 289 in AttachmentBehavior.php):
Example: Original:
Finally,(work without warning)