0

I have a model in an extension. I want to add a new database attribute and make this value editable through Magento admin using Varien_Data_Form. I have added the field to the database through installer script, the field is displayed on the admin, but I don't know how to save it.

The form data is posted and saved to a $data variable, the model is loaded and has a setData($data) called, and after that the model is saved, but to no avail. Dumping $data just before the setData() call shows the variable is fine.

Saving occurs inside a try block, no errors are thrown/catched.

...

$model = Mage::getModel('cmspro/category');
$model->setData($data)->setId($this->getRequest()->getParam('id'));

...

try {

...

$model->save();

...

} catch (Exception $e) {

...

}
1

After changing the structure of a table clear the cache.
Delete the contents of var/cache.
Even if the cache is disabled the table schema is still cached by Zend Framework.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.