I have a problem with inserting value to wysiwyg editor when editing item in collection. I have this code, but editor still remain null.
$content = Mage::getModel('news/news')->load($this->getRequest()->getParam('id'));
$fieldset->addField('ContentText', 'editor', array(
'name' => 'content',
'label' => Mage::helper('news')->__('Content'),
'title' => Mage::helper('news')->__('Content'),
'style' => 'height:20em;width:70em;',
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
'value' => $content['content'],
'wysiwyg' => true,
'required' => true,
));
when i call
die($content['content']);
I get my requested value
$form->setValues()
later in the code. That will override the value of your field.$form->setValues()
. Try using$form->addValues()
instead and make sure that there is nocontent
element in the array you pass as a parameter toaddValues
.