if (!empty($DAOField['component']) && !\CRM_Core_Component::isEnabled($DAOField['component'])) {
continue;
}
- if ($DAOField['name'] == 'is_active' && empty($DAOField['default'])) {
- $DAOField['default'] = '1';
- }
$this->setDynamicFk($DAOField, $values);
$field = SpecFormatter::arrayToField($DAOField, $entityName);
$spec->addFieldSpec($field);
$this->assertContains('foo', $fieldNames);
}
+ public function testIsActiveFieldCanDefaultToFalse(): void {
+ $gatherer = new SpecGatherer();
+ // Use Dashboard as it has is_active field and that defaults to 0 (according to schema)
+ $specs = $gatherer->getSpec('Dashboard', 'create', FALSE);
+ self::assertFalse($specs->getFieldByName('is_active')->getDefaultValue(), 'Default value for "is_active" field is not false');
+ }
+
}