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) {
...
}
Fabian Schmengler
66.2k25 gold badges191 silver badges422 bronze badges
asked Feb 28, 2014 at 11:39
1
  • So what is the problem? Where is the question? Commented Feb 28, 2014 at 11:49

1 Answer 1

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.

answered Feb 28, 2014 at 12:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.