Fielded Relation’s Field not showing in Views

I’m trying to implement a “rating” system with Relation module. I have a Relation Type defined from a user –> node. The Relation Type has an Integer field to hold the rating.

I want to produce a view that shows the number of ratings and average rating. To start, I created a view with a list of nodes. I previously created a few “rating” relations between users and the nodes in the view, which can be seen in the Relations tab in content.

In views UI Advanced section, I added the Relationship from the node to its Relation. I added a view field for the Integer field on the Relation.

The label for the rating field shows, but the number is empty, even for relations I know are there.

Here is an export of the view:

$view = new view(); $view->name = 'offer_ratings'; $view->description = ''; $view->tag = 'default'; $view->base_table = 'node'; $view->human_name = 'Offer Ratings'; $view->core = 7; $view->api_version = '3.0'; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */  /* Display: Master */ $handler = $view->new_display('default', 'Master', 'default'); $handler->display->display_options['title'] = 'Offer Ratings'; $handler->display->display_options['use_more_always'] = FALSE; $handler->display->display_options['access']['type'] = 'perm'; $handler->display->display_options['cache']['type'] = 'none'; $handler->display->display_options['query']['type'] = 'views_query'; $handler->display->display_options['exposed_form']['type'] = 'basic'; $handler->display->display_options['pager']['type'] = 'full'; $handler->display->display_options['pager']['options']['items_per_page'] = '100'; $handler->display->display_options['style_plugin'] = 'default'; $handler->display->display_options['row_plugin'] = 'fields'; /* Relationship: Content: Relation: rated by (node → relation) */ $handler->display->display_options['relationships']['relation_base_right_rated']['id'] = 'relation_base_right_rated'; $handler->display->display_options['relationships']['relation_base_right_rated']['table'] = 'node'; $handler->display->display_options['relationships']['relation_base_right_rated']['field'] = 'relation_base_right_rated'; $handler->display->display_options['relationships']['relation_base_right_rated']['r_index'] = '1'; $handler->display->display_options['relationships']['relation_base_right_rated']['entity_deduplication_right'] = 0; /* Field: Content: Title */ $handler->display->display_options['fields']['title']['id'] = 'title'; $handler->display->display_options['fields']['title']['table'] = 'node'; $handler->display->display_options['fields']['title']['field'] = 'title'; $handler->display->display_options['fields']['title']['label'] = ''; $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE; $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE; /* Field: Relation: Rating */ $handler->display->display_options['fields']['field_rating']['id'] = 'field_rating'; $handler->display->display_options['fields']['field_rating']['table'] = 'field_data_field_rating'; $handler->display->display_options['fields']['field_rating']['field'] = 'field_rating'; $handler->display->display_options['fields']['field_rating']['relationship'] = 'relation_base_right_rated'; $handler->display->display_options['fields']['field_rating']['settings'] = array(   'thousand_separator' => '',   'prefix_suffix' => 1, ); /* Sort criterion: Content: Post date */ $handler->display->display_options['sorts']['created']['id'] = 'created'; $handler->display->display_options['sorts']['created']['table'] = 'node'; $handler->display->display_options['sorts']['created']['field'] = 'created'; $handler->display->display_options['sorts']['created']['order'] = 'DESC'; /* Filter criterion: Content: Published */ $handler->display->display_options['filters']['status']['id'] = 'status'; $handler->display->display_options['filters']['status']['table'] = 'node'; $handler->display->display_options['filters']['status']['field'] = 'status'; $handler->display->display_options['filters']['status']['value'] = 1; $handler->display->display_options['filters']['status']['group'] = 1; $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE; /* Filter criterion: Content: Type */ $handler->display->display_options['filters']['type']['id'] = 'type'; $handler->display->display_options['filters']['type']['table'] = 'node'; $handler->display->display_options['filters']['type']['field'] = 'type'; $handler->display->display_options['filters']['type']['value'] = array(   'offer' => 'offer', );  /* Display: Page */ $handler = $view->new_display('page', 'Page', 'page'); $handler->display->display_options['path'] = 'offer-ratings'; 
This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Fielded Relation’s Field not showing in Views

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.