I have posted this to the location forum, but no response so far
https://drupal.org/node/2022843

I am showing a list of nodes (of a certain type) and their addresses. Location CCK field holds addresses and displays fine on node (and in map on node).

Suddenly, when I added the address field extra rows appeared, repeating a node title and NID but pulling in a random other address. Both rows in the view link to the same node (same nid) with the correct address. I searched through the database for a strange street address and found it in an unrelated Ubercart order by a different user than the node author (!!)

If I remove the location field from the view, all goes back to normal, which is why I'm posting here rather than in the views issues.

Attached is a screenshot of my (simplified) testing views showing the duplicates that appear, not every node shows a duplicate.

Here is the view code if that helps: THANKS!
$view = new view();
$view->name = 'neighborhood_testing';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'test neighborhood listings';
$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'] = 'neighborhood listings';
$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['query']['options']['distinct'] = TRUE;
$handler->display->display_options['query']['options']['pure_distinct'] = TRUE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* 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: Content: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['label'] = 'NID';
/* Field: Location: Street */
$handler->display->display_options['fields']['street']['id'] = 'street';
$handler->display->display_options['fields']['street']['table'] = 'location';
$handler->display->display_options['fields']['street']['field'] = 'street';
$handler->display->display_options['fields']['street']['label'] = '';
$handler->display->display_options['fields']['street']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['street']['style'] = 'street';
/* Sort criterion: Field: last name (field_last) */
$handler->display->display_options['sorts']['field_last_value']['id'] = 'field_last_value';
$handler->display->display_options['sorts']['field_last_value']['table'] = 'field_data_field_last';
$handler->display->display_options['sorts']['field_last_value']['field'] = 'field_last_value';
/* 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(
'postprofile' => 'postprofile',
'partner_profile' => 'partner_profile',
);
$handler->display->display_options['filters']['type']['group'] = 1;

MORE INFO -- if, when adding the field to the view I use Content: studio address, rather than Location: Address it works fine.

NOTE: if I use both, I get the duplicates with the bad data in only one of the fields. The attached capture shows a display in the view for one node, showing the location field twice (once as Content: studio address, again as Location:Address -- should be the same data but it is not. 2nd address is unrelated).

So, using only the Content: studio address fixed it for the text listing. So I hoped that would work for map nodes, but no, a dupe pin shows up in the wrong location.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stellarvisions’s picture

https://drupal.org/project/views_distinct

solved 99% of my problem. A few outliers, while not duplicated, are appearing in the wrong spot still.

stellarvisions’s picture

Issue summary: View changes

fixed typo

MustangGB’s picture

Status: Active » Closed (outdated)