Problem/Motivation

Mail entity queue item entity custom fields doesn't show in when trying to Add Field in Views.

Steps to reproduce

1. Add a new field to entity Mail entity queue item.
2. Create a view that shows a table of Mail entity queue item entities.
3. Try to add your new field in the view. It doesn't show.

Proposed resolution

In the entity annotation, remove data_table. Views associates the fields with data_table but as the entity is not translatable, data_table is not used as only translatable entities have it.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

evamtinez created an issue. See original summary.

evamtinez’s picture

facine’s picture

Status: Active » Needs work

I get this error on the status page, so we need to update also the entity definition:

Mail entity queue item
The Mail entity queue item entity type needs to be updated.

function hook_update_N(&$sandbox) {
  $entity_type = \Drupal::entityTypeManager()->getDefinition('mail_entity_queue_item');
  $field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('mail_entity_queue_item');

  \Drupal::service('entity.definition_update_manager')
    ->updateFieldableEntityType($entity_type, $field_storage_definitions, $sandbox);
}
evamtinez’s picture

Fixed patch including hook_update. Thanks @facine.

  • facine committed 40881c47 on 8.x-1.x authored by evamtinez
    Issue #3333030 by evamtinez, facine: Mail entity queue item entity...
facine’s picture

Fixed, thanks!

facine’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.