I have a custom entity that fieldable. I need to add a field to it, and I want to do it through the UI. The entity was created in a custom module, which I can modify.
How can I make the entity fieldable?
/** * Defines the Quiz entity. * * @ingroup qwizard * * @ContentEntityType( * id = "qwiz", * label = @Translation("Quiz"), * bundle_label = @Translation("Quiz type"), * handlers = { * "storage" = "Drupal\qwizard\QwizStorage", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", * "list_builder" = "Drupal\qwizard\QwizListBuilder", * "views_data" = "Drupal\qwizard\Entity\QwizViewsData", * * "form" = { * "default" = "Drupal\qwizard\Form\QwizForm", * "add" = "Drupal\qwizard\Form\QwizForm", * "edit" = "Drupal\qwizard\Form\QwizForm", * "delete" = "Drupal\qwizard\Form\QwizDeleteForm", * }, * "access" = "Drupal\qwizard\QwizAccessControlHandler", * "route_provider" = { * "html" = "Drupal\qwizard\QwizHtmlRouteProvider", * }, * }, * base_table = "qwiz", * revision_table = "qwiz_revision", * revision_data_table = "qwiz_field_revision", * admin_permission = "administer quiz entities", * entity_keys = { * "id" = "id", * "revision" = "vid", * "bundle" = "type", * "label" = "name", * "uuid" = "uuid", * "uid" = "user_id", * "langcode" = "langcode", * "status" = "status", * }, * links = { * "canonical" = "/admin/structure/qwizard/qwiz/{qwiz}", * "add-page" = "/admin/structure/qwizard/qwiz/add", * "add-form" = "/admin/structure/qwizard/qwiz/add/{qwiz_type}", * "edit-form" = "/admin/structure/qwizard/qwiz/{qwiz}/edit", * "delete-form" = "/admin/structure/qwizard/qwiz/{qwiz}/delete", * "version-history" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions", * "revision" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions/{qwiz_revision}/view", * "revision_revert" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions/{qwiz_revision}/revert", * "revision_delete" = "/admin/structure/qwizard/qwiz/{qwiz}/revisions/{qwiz_revision}/delete", * "collection" = "/admin/structure/qwizard/qwiz", * }, * bundle_entity_type = "qwiz_type", * field_ui_base_route = "entity.qwiz_type.edit_form" * ) */
bundle_entity_typeset in your entity annotation?