0

class Magestore_Giftvoucher_Block_Product_Upload extends Mage_Adminhtml_Block_Media_Uploader {

public function __construct()
{
    parent::__construct();
    $this->setId($this->getId() . '_Uploader');
    $this->setTemplate('');
    $this->getConfig()->setUrl($this->getUrl('giftvoucher/index/customUpload'));
    $this->getConfig()->setParams();
    $this->getConfig()->setFileField('image');
    $this->getConfig()->setFilters(array(
        'images' => array(
            'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'),
            'files' => array('*.gif', '*.jpg', '*.png')
        )
    ));
    $this->getConfig()->setWidth(32);
}

public function getDeleteButtonHtml()
{
    $this->setChild(
        'delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id' => '{{id}}-delete',
                'class' => 'delete',
                'type' => 'button',
                'label' => Mage::helper('adminhtml')->__(''),
                'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')',
                'style' => 'display:none'
            ))
    );
    return $this->getChildHtml('delete_button');
}

public function getDataMaxSize()
{
    $dataSize = Mage::helper('giftvoucher')->getInterfaceConfig('upload_max_size');
    if (is_nan($dataSize) || $dataSize <= 0) {
        $dataSize = 500;
    }
    return $dataSize . 'K';
}

}

1 Answers1

4

Had this same error come up for me also. What I did was go over mage store site and login into your account and download the latest version of the gift card extension (currently 4.6). Update your copy of the extension on your site. I was still getting this error after updating so I edited the file upload.php file (located at: /app/code/local/Magestore/Giftvoucher/Block/product/upload.php). Change line 43 if (version_compare($magentoVersion, '1.9.3', '>=')){ to if(class_exists("Mage_Uploader_Block_Abstract")){ and you will not get the error anymore

Mike
  • 56
  • 3