Base tables that don't have the entity type declared don't get the query-plugin-independent fields available, which is problematic.

CommentFileSizeAuthor
always-declare-entity_type.patch1.05 KBbojanz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Status: Needs review » Needs work

I committed this because the existing (not much) test didnt break but -- how would you go writing a test for this?

-  $data['efq_' . $type]['table']['base']['entity type'] = $type;
+  $data['efq_' . $type]['table']['entity type'] = $type;

base is gone. Either something was broken and got fixed (which can be tested) or something is broken and can be fixed which again can be tested.

bojanz’s picture

Base is gone because Views changed the format at one point.

A test would declare a "global" field attached to a certain entity type, then check if efq_views can see it.
Or check for an existing one, like the node edit field, which is defined by Views like this:

$data['views_entity_node']['edit_node'] = array(
    'field' => array(
      'title' => t('Edit link'),
      'help' => t('Provide a simple link to edit the content.'),
      'handler' => 'views_handler_field_node_link_edit',
    ),
  );
chx’s picture

Status: Needs work » Fixed

Thanks for the idea.

Status: Fixed » Closed (fixed)

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