Posted on August 6, 2014 by Neo in Tutorials
If you are experiencing the "MediabrowserUtility is not defined" error when trying to add an image via the Magento WYSIWYG editor, here are steps you can try to fix it:
Following are steps to fix this issue:
Step 1: Add the following code into your field app/code/local/Namespace/Module/Block/Adminhtml/Item/Edit.php:
protected function _prepareLayout() { if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); } parent::_prepareLayout(); }
Step 2: Open app/code/local/Namespace/Module/Block/Adminhtml/Item/Edit/Tab/Form.php and add this code before your editor field:
$configSettings = Mage::getSingleton('cms/wysiwyg_config')->getConfig( array( 'add_widgets' => false, 'add_variables' => false, 'add_images' => false, 'files_browser_window_url'=> $this->getBaseUrl().'admin/cms_wysiwyg_images/index/', ));
Step 3: Finally, open module.xml file that is in app/design/adminhtml/default/default/layout and add the following code:
<module_adminhtml_item_edit> <reference name="head"> <action method="addItem"><type>js</type><name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name></action> <action method="addItem"><type>js</type><name>tiny_mce/tiny_mce.js</name></action> </reference> <update handle="editor"/> </module_adminhtml_item_edit>
Awesome tutorial !. Thanks you very much.
sorry, It don't work. MediabrowserUtility Is Not Defined still show
I use Magebuzz-events-calendar.
Hello,
I am new in magento 2, I have this problem but in magento 2, do you have the solution for magento 2? thank you