Hello, I have a problem adding a new
TextField
to a page. I have the following code:
PortofoliuPage.php
<?php
class PortofoliuPage extends Page {
static $db = array(
);
static $has_one = array(
'Photo' => 'Image',
'Desc' => 'Text'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Images", new ImageField('Photo'));
$fields->addFieldToTab("Root.Content.Images", new TextField('Desc'));
return $fields;
}
}
class PortofoliuPage_Controller extends Page_Controller {
}
?>
I flush the database and the admin panel. In the admin panel I add a PortofoliuHolder page. In the PortofoliuHolder page I add a PortofoliuPage.
I add the details for PortofoiuPage, including an Photo and a Desc. I press the Save and Publish button. Now the problem:
When I refresh the page, the information I entered in the Desc field dissapears
(The photo don't)
I looked in the database in the PortofoliuPage table, and there are two columns there: an id for the photo and an id for the Desc (0 value).
Note that I tried to drop the entire database and create it again.
A bug in the CMS? Am I mistaking? Please help me!
Thanks,
Danix
redarts