magento/magento2 — pull request #156 by Schrank (2012-12-06 13:19:30+00:00)
Title: Event adminhtml_cms_page_edit_tab_content_prepare_form and $form->setValues($model->getData()); in wrong order

Problem exists in 1.7.0.2 too: http://www.magentocommerce.com/bug-tracking/issue?issue=14477

app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php:98 the event adminhtml_cms_page_edit_tab_content_prepare_form is dispatched. Two lines before the values are set on the form ($form->setValues($model->getData());)

This order is only in the content tab. In the other tabs: design, main and meta the order is the other way around, e.g.

app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php:125

Mage::dispatchEvent('adminhtml_cms_page_edit_tab_design_prepare_form', array('form' => $form));
$form->setValues($model->getData());
$this->setForm($form);

To add new fields to the form and fill them automatically from the database it is important to change the order of the event and the setValues statement.