In my module i programmatically add user fields for the website owner instead of instructing them to do so. Here's an example of the code i used which runs in mymodule.install:
function openid_connect_entity_base_field_info(EntityTypeInterface $entity_type) {
if ($entity_type->id() === 'user') {
$fields['field_birthdate'] = BaseFieldDefinition::create('string')
->setLabel(t('Birthdate'))
->setDescription(t('Add a description'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDisplayOptions('form', array(
'type' => 'string_text_field',
'weight' => 30,
'default_value' => 0,
))
->setDisplayConfigurable('form', TRUE);
}
return fields;
}
but if you add a field manually all the programmatically added fields will be deleted as shown:
programmatically added fields before adding one manually
Adding a field manually
And boom all the programmatically fields are gone!
If this is a bug in the drupal 8 framework where do i report this?