Have you switched off and cleared compilation?
via the console/ssh you can use
$ php -f shell/compiler.php -- disable
$ php -f shell/compiler.php -- clear
$ php -f shell/compiler.php -- compile
$ php -f shell/compiler.php -- enable
might need the fourth line...not sure.
It might be a problem with the line that comes before the code you showed
$routersInfo = Mage::app()->getStore()->getConfig(self::XML_STORE_ROUTERS_PATH);
Note: I had a similar problem where the admin was blank, however that turned out to be a file in a module that was overriding one of the core files - but this is not in your case. Just in case others look at this with that issue.
Mage_Adminhtml_Block_Media_Uploader
is deprecated on after SUPEE-8788 (and 1.9.3). Thus there are several backward incompatibility changes which breaks module using the uploader.
I first thought a small change would fix it but there's actually way more to do.
Make a module using the gallery compatible with 1.9.2 and 1.9.3
So if you're a module provider, you don't want to have two different versions of your module for 1.9.2 and 1.9.3. Here's how to make your code compatible with both:
In your block _prepareLayout
method you need to do the following:
Replace:
$this->getUploader()->getConfig()
->setUrl($url)
->setFileField('image')
->setFilters(array(
'images' => array(
'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'),
'files' => array('*.gif', '*.jpg','*.jpeg', '*.png')
)
));
With:
if (class_exists("Mage_Uploader_Block_Abstract")) {
// PATCH SUPEE-8788 or Magento 1.9.3
$this->getUploader()->getUploaderConfig()
->setFileParameterName('image')
->setTarget($url);
$browseConfig = $this->getUploader()->getButtonConfig();
$browseConfig
->setAttributes(
array("accept" => $browseConfig->getMimeTypesByExtensions('gif, png, jpeg, jpg'))
);
} else {
$this->getUploader()->getConfig()
->setUrl($url)
->setFileField('image')
->setFilters(array(
'images' => array(
'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'),
'files' => array('*.gif', '*.jpg','*.jpeg', '*.png')
)
));
}
As you can see I'm using class_exists
to check whether SUPEE-8788 or Magento 1.9.3 is applied.
Then in your gallery.phtml
you need to replace:
var <?php echo $_block->getJsObjectName(); ?> = new Product.Gallery('<?php echo $_block->getHtmlId() ?>', <?php if ($_block->getElement()->getReadonly()):?>null<?php else:?><?php echo $_block->getUploader()->getJsObjectName() ?><?php endif;?>, <?php echo $_block->getImageTypesJson() ?>);
With:
<?php if (class_exists("Mage_Uploader_Block_Abstract")): ?>
var <?php echo $_block->getJsObjectName(); ?> = new Product.Gallery('<?php echo $_block->getHtmlId() ?>', <?php echo $_block->getImageTypesJson() ?>);
<?php else: ?>
var <?php echo $_block->getJsObjectName(); ?> = new Product.Gallery('<?php echo $_block->getHtmlId() ?>', <?php if ($_block->getElement()->getReadonly()):?>null<?php else:?><?php echo $_block->getUploader()->getJsObjectName() ?><?php endif;?>, <?php echo $_block->getImageTypesJson() ?>);
<?php endif; ?>
Then for the layout file, you can do it like this:
<reference name="head">
<action method="addJs"><file helper="module/getFlowMin" /></action>
<action method="addJs"><file helper="module/getFustyFlow" /></action>
<action method="addJs"><file helper="module/getFustyFlowFactory" /></action>
<action method="addJs"><file helper="module/getAdminhtmlUploaderInstance" /></action>
</reference>
Replace module
with your helper class identifier and in your module Data.php
helper add the following:
protected function _isNoFlashUploader()
{
return class_exists("Mage_Uploader_Block_Abstract");
}
public function getFlowMin()
{
return $this->_isNoFlashUploader() ? "lib/uploader/flow.min.js" : null;
}
public function getFustyFlow()
{
return $this->_isNoFlashUploader() ? "lib/uploader/fusty-flow.js" : null;
}
public function getFustyFlowFactory()
{
return $this->_isNoFlashUploader() ? "lib/uploader/fusty-flow-factory.js" : null;
}
public function getAdminhtmlUploaderInstance()
{
return $this->_isNoFlashUploader() ? "mage/adminhtml/uploader/instance.js" : null;
}
Best Answer
Fixed - Image Upload issue after PATCH 8788 install of Magento version CE 1.7.0.2 - 1.9.2.4.
I was able to fix it,Please Follow following instruction.