I have a system with the rank and mosul votingAPI fivestar, and show that rank with views.
The problem is that when the site runs on the local server, no problems, it works just fine. Just up to an online server that duplicates the view when more than one user vote.
The view appears to duplicate only the Anonymous User when the User logs in some duplication ...
Can anyone help me? This seems something like permissions, but I tried everything and nothing
site: http://www.rankofbands.com

Comments

merlinofchaos’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

There's no way for anyone to help you without knowing more about your data and the view.

Duplicates usually occur when you are using fields or relationships that have a many to one relationship with the core, and you appear to get duplicates because each item associated gets a record.

For example, if you have a node with two taxonomy terms, and you use the simple taxonomy term field, you'll get one record for the first term and one record for the second term, making all of the node fields appear duplicated. I've tried to put warnings on all fields that can cause duplicates, but when other modules are involved, it's difficult.

Worse, you're using votingapi, and votingapi has fairly complex relationships. You might need to ask in the votingapi queue (though I imagine that's fairly quiet as I know the maintainer is very very busy and does not get to the issue queues often).

Sometimes the DISTINCT setting can remove duplicates, but not always.

This is almost certainly not a bug, duplicates are almost always configuration error and the view has to be set up properly.

caionalves’s picture

What can I do in a case like this? Here is my view and thanks for helping me!

$view = new view;
$view->name = 'rank';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'votingapi_cache' => array(
'label' => 'Vote results',
'required' => 0,
'votingapi' => array(
'value_type' => 'percent',
'value_type_other' => '',
'tag' => 'vote',
'tag_other' => '',
'function' => 'average',
'function_other' => '',
),
'id' => 'votingapi_cache',
'table' => 'node',
'field' => 'votingapi_cache',
'relationship' => 'none',
),
'votingapi_vote' => array(
'label' => 'Individual Votes',
'required' => 0,
'votingapi' => array(
'value_type' => 'percent',
'value_type_other' => '',
'tag' => 'vote',
'tag_other' => '',
),
'current_user' => TRUE,
'id' => 'votingapi_vote',
'table' => 'node',
'field' => 'votingapi_vote',
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'field_bandname_value' => array(
'label' => 'Band Name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => 'band/[field_bandname_value]',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'custom',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 1,
'id' => 'field_bandname_value',
'table' => 'node_data_field_bandname',
'field' => 'field_bandname_value',
'relationship' => 'none',
),
'value_1' => array(
'label' => 'My rating',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'set_precision' => 0,
'precision' => '0',
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => 'fivestar_views_widget_normal_handler',
'exclude' => 1,
'id' => 'value_1',
'table' => 'votingapi_vote',
'field' => 'value',
'relationship' => 'votingapi_vote',
),
'value' => array(
'label' => 'Average Rating',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'set_precision' => 0,
'precision' => '0',
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => 'fivestar_views_value_display_handler',
'exclude' => 1,
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache',
),
'counter' => array(
'label' => 'Position',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 1,
'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
),
'nothing' => array(
'label' => '',
'alter' => array(
'text' => '

[field_bandname_value]
[value_1]
[value]
[counter]

',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'nothing',
'table' => 'views',
'field' => 'nothing',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'value' => array(
'order' => 'DESC',
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'profile' => 'profile',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('style_options', array(
'grouping' => '',
));

caionalves’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active
dawehner’s picture

Priority: Critical » Normal

I guess:


'value_1' => array(
'label' => 'My rating',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'set_precision' => 0,
'precision' => '0',
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => 'fivestar_views_widget_normal_handler',
'exclude' => 1,
'id' => 'value_1',
'table' => 'votingapi_vote',
'field' => 'value',
'relationship' => 'votingapi_vote',
),

Is the problem. This field shows a single user, but the anonymous user can vote multiple times on a nodel

caionalves’s picture

And what do you think I should do?
I already removed this field and still doubling ...
Would have a solution?

Tnx!

merlinofchaos’s picture

Maybe you should try voting api queue -- I'm not super familiar with voting api views and how exactly they need to be formed.

caionalves’s picture

you are referring to Nodequeue module?

merlinofchaos’s picture

I mean the voting api issue queue. i.e, try posting there.

caionalves’s picture

Status: Active » Closed (fixed)

Haaa ok! Tnx