Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>"Official" fix included in Magento 2:</p> <pre><code>class Mage_Catalog_Model_Category_Attribute_Backend_Image extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract { /** * Save uploaded file and set its name to category * * @param Varien_Object $object * @return Mage_Catalog_Model_Category_Attribute_Backend_Image */ public function afterSave($object) { $value = $object-&gt;getData($this-&gt;getAttribute()-&gt;getName()); // if no image was set - nothing to do if (empty($value) &amp;&amp; empty($_FILES)) { return $this; } if (is_array($value) &amp;&amp; !empty($value['delete'])) { $object-&gt;setData($this-&gt;getAttribute()-&gt;getName(), ''); $this-&gt;getAttribute()-&gt;getEntity() -&gt;saveAttribute($object, $this-&gt;getAttribute()-&gt;getName()); return $this; } $path = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'category' . DS; try { $uploader = new Mage_Core_Model_File_Uploader($this-&gt;getAttribute()-&gt;getName()); $uploader-&gt;setAllowedExtensions(array('jpg','jpeg','gif','png')); $uploader-&gt;setAllowRenameFiles(true); $result = $uploader-&gt;save($path); $object-&gt;setData($this-&gt;getAttribute()-&gt;getName(), $result['file']); $this-&gt;getAttribute()-&gt;getEntity()-&gt;saveAttribute($object, $this-&gt;getAttribute()-&gt;getName()); } catch (Exception $e) { if ($e-&gt;getCode() != Mage_Core_Model_File_Uploader::TMP_NAME_EMPTY) { Mage::logException($e); } /** @TODO ??? */ } return $this; } } </code></pre> <p><a href="https://github.com/magento/magento2/blob/0c3e67e9c25cbddcb6c957b00164552b9110cf3b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php">https://github.com/magento/magento2/blob/0c3e67e9c25cbddcb6c957b00164552b9110cf3b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload