Reputation: 157
I've added an extra date field inside my categories lang table. All data is saving correctly however when trying to display the data inside renderForm I get no value. If I change the type to "text" the value displays just fine.
Any help is appreciated as I've searched far and beyond now without an answer. I've also tried editing the field type inside the database table.
This is my renderForm method and the field I'm having trouble with:
public function renderForm() {
$this->fields_form_override = array(
array(
'type' => 'datetime',
'label' => $this->l('Startdato'),
'name' => 'cat_start_date',
'lang' => true,
'autoload_rte' => true,
'hint' => 'Fx 14. september'
),
This is my Category class overrides:
public $cat_start_date;
public $cat_end_date;
public $cat_order_due_date;
public $cat_location;
public $cat_special_msg;
public function __construct($id_category = null, $id_lang = null, $id_shop = null) {
self::$definition['fields']['cat_start_date'] = array('type' => self::TYPE_DATE, 'lang' => true, 'validate' => 'isDate');
self::$definition['fields']['cat_end_date'] = array('type' => self::TYPE_DATE, 'lang' => true, 'validate' => 'isDate');
self::$definition['fields']['cat_order_due_date'] = array('type' => self::TYPE_DATE, 'lang' => true, 'validate' => 'isDate');
self::$definition['fields']['cat_location'] = array('type' => self::TYPE_STRING, 'lang' => true);
self::$definition['fields']['cat_special_msg'] = array('type' => self::TYPE_STRING, 'lang' => true);
parent::__construct($id_category, $id_lang, $id_shop);
}
Upvotes: 0
Views: 597