Having this code:
function mymybase_update_7200(){
if(!field_info_field('field_timer_exam')){
$field = [
'field_name' => 'field_timer_exam',
'label' => 'Countdown timer',
'type' => 'mymy_field_countdown',
];
field_create_field($field);
$instance = [
'field_name' => 'field_timer_exam',
'entity_type' => 'user',
'bundle' => 'user',
'label' => 'Countdown timer',
'settings' => [
'user_register_form' => 0,
],
'widget' => [
'type' => 'mymy_field_countdown_widget',
'settings' => [
'display_label' => TRUE,
],
],
];
field_create_instance($instance);
}
if(!field_info_field('field_timer_final_exam')){
$field = [
'field_name' => 'field_timer_final_exam',
'label' => 'Countdown timer',
'type' => 'mymy_field_countdown',
];
field_create_field($field);
$instance = [
'field_name' => 'field_timer_final_exam',
'entity_type' => 'user',
'bundle' => 'user',
'label' => 'Countdown timer',
'settings' => [
'user_register_form' => 0,
],
'widget' => [
'type' => 'mymy_field_countdown_widget',
'settings' => [
'display_label' => TRUE,
],
],
];
field_create_instance($instance);
}
}
Which i think it is ok, field get created when running in the hook_menu page callback for example, but during installation the fields does not get created.
There is no error in the watchdog nor in apache logs, the field does not exist in the user entity nor tables like field_data_field_timer_exam
The update get fired, at system
table i can see the schema_version
columna get updated for my module
What could be happening?