I have worked in views a lot but recently when i am working in Views 6.x-2.6 i get duplicate results. I also tried using node:distinct option yet the same error.

Anybody had this problem with views? I am utterly in need, have to shoot off this error as soon as possible.

Please share your suggestions. Thanks in advance.

Comments

mohanrajthangarasu’s picture

I have this problem for a particular site in a server but i dont views problem other domains hosted in that same server.

Neither some patch nor the distinct works for me. can anybody help me to sort out this issue?

archi’s picture

Hi,

I have tried on my Test site it works for me.
You have page view or block view ?
Can you try selecting Sort criteria : Node: Post date desc

mohanrajthangarasu’s picture

I have tried all you said but yet no solution. I have also tried some patches. this error is becoming so hectic.

any views giants ?

archi’s picture

Hi,

Can you send me your export code of views so that i can try on my site and check ?
Or else you can tell me the steps what you have done so that i can figured out the problem,
if you can..

mohanrajthangarasu’s picture

I just installed drupal as usual and also installed views module. When i created a field for user name and saved the view, i get two user name as "admin".

below is the exported code:

$view = new view;
$view->name = 'sd';
$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('fields', array(
  'name' => array(
    'label' => 'Name',
    '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,
    ),
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('distinct', 1);

archi’s picture

Hi,

From your view what i can figure out is you want user to be listed.
Can you try creating view by selecting below type,

* User
Users who have created accounts on your site.

rather than

* Node
Nodes are a Drupal site's primary content.

Or i have missed your agenda ?

mohanrajthangarasu’s picture

hi

Thanks for your comment. It really helped me.

Yet listing users is one of my example situation. Whether it is user or node, i get the same duplicate result. what shall i do if this is the case?

pinky.evakoss’s picture

Hello,

I imported your view just used 'user' type instead of 'node' type and it worked for me.
try this.

$view = new view;
$view->name = 'sd';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'users';
$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('fields', array(
  'name' => array(
    'label' => 'Name',
    '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,
    ),
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('distinct', 1);

Regards,
Pinky

fresh-off’s picture

this worked for me as well!!

ronline’s picture

I’ve had a problem with duplicated images.
It can be fixed by admin interface => http://drupal.org/node/661262