From a188f7a08fd0b72177ea6137b62c7f7c8e879cba Mon Sep 17 00:00:00 2001 From: Nick Palmer Date: Sun, 9 Nov 2008 20:16:00 +0000 Subject: Fix is_primary jumping around with ajax uploads and allow primary_label to persist. --- attachment_uploader.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'attachment_uploader.php') diff --git a/attachment_uploader.php b/attachment_uploader.php index 2b5da66..b9f08d1 100644 --- a/attachment_uploader.php +++ b/attachment_uploader.php @@ -1,6 +1,6 @@ isValid() ){ // if we dont have a content object for this attachment yet, lets create a draft. @@ -66,8 +68,8 @@ if( isset( $gContent ) ){ $error = $gContent->mErrors; }else{ // Load up the new attachment. - if ( !empty($storeHash['STORAGE'] ) ) { - foreach ( $storeHash['STORAGE'] as $id => $file ) { + if ( !empty($storeHash['upload_store'] ) ) { + foreach ( $storeHash['upload_store'] as $id => $file ) { if ( $id != 'existing' ) { foreach ( $file as $key => $data ) { $gContent->mStorage[$data['attachment_id']] = $gContent->getAttachment( $data['attachment_id'] ); @@ -96,6 +98,10 @@ $gBitSmarty->assign( 'gContent', $gContent ); $gBitSmarty->assign( 'libertyUploader', TRUE ); $gBitSmarty->assign( 'uploadTab', TRUE ); +if( !empty( $_REQUEST['liberty_attachments']['primary_label'] ) ) { + $gBitSmarty->assign('primary_label', $_REQUEST['liberty_attachments']['primary_label']); +} + if( isset( $_REQUEST['liberty_attachments']['form_id'] ) ){ $gBitSmarty->assign( 'form_id', $_REQUEST['liberty_attachments']['form_id'] ); } -- cgit v1.3