Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291721

provide Views reverse relationships automatically for entity base fields

$
0
0

core_field_views_data() provides reverse relationships for entity reference fields, but this is only for config fields.

For base fields on entities, such as the node uid field, core entity modules have to implement this themselves.

Eg UserViewsData::UserViewsData():

    $data['users_field_data']['uid']['relationship'] = array(
      'title' => t('Content authored'),
      'help' => t('Relate content to the user who created it. This relationship will create one record for each content item created by the user.'),
      'id' => 'standard',
      'base' => 'node_field_data',
      'base field' => 'uid',
      'field' => 'uid',
      'label' => t('nodes'),
    );

Viewing all articles
Browse latest Browse all 291721

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>