(Newbie)
Hi,
For some reason, whenever I save a StudentPage entry in the backend, boolean fields such as ‘Active’ (see below) are always saved with a value of 1 (i.e: true) no matter what. I tried replacing the value of 1 and 0 (below) by true and false, same problem. I had initially defined $db = [ ’ Active’ => ‘Boolean(1)’ , // …] but I do not think it is relevant.
Any idea ?
Thanks.
K.
(StudentPage.php)
private static $db = [
'Active' => 'Boolean',
// ...
];
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields>addFieldToTab('Root.Main',DropdownField::create('Active','Active user',['True' => 1,'False' => 0 ]),'Content');
// ...
}