Hi, I have two views that are acting mighty quirky and I'm at a loss on where the problem lies. The first one is my "recent comments" view which gets comments and looks OK, but it never gets *all* of the recent comments, and no matter how much I clear cache or force it to update, I never manage to make it do so. Is there something wrong with the view itself? It's been like this in several versions of views so I don't think there's a problem with the 2.12 version, rather I must have done something to not make the view work properly. It might even be really obvious, I'm just not seeing it. It could be that the views are "perfect" (if so, let me know) and I should concentrate my hunt to the comments module and twitter module.

$view = new view;
$view->name = 'TMA_RECCOM';
$view->description = 'TMA_reccom_m';
$view->tag = 'TMA recent comments';
$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', 'TMA_reccom', 'default');
$handler->override_option('fields', array(
  'name' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '[name]',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'exclude' => 0,
    'id' => 'name',
    'table' => 'comments',
    'field' => 'name',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'nothing' => array(
    'label' => '',
    'alter' => array(
      'text' => '  said: ',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'nothing',
    'table' => 'views',
    'field' => 'nothing',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'comment' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 1,
      'max_length' => '100',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 1,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'comment',
    'table' => 'comments',
    'field' => 'comment',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 1,
      'max_length' => '65',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 1,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'replyto_comment' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '[replyto_comment] ',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'text' => '',
    'exclude' => 0,
    'id' => 'replyto_comment',
    'table' => 'comments',
    'field' => 'replyto_comment',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'nothing_1' => array(
    'label' => '',
    'alter' => array(
      'text' => ' or ',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'nothing_1',
    'table' => 'views',
    'field' => 'nothing',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'view_comment' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '[view_comment]',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'text' => '',
    'exclude' => 0,
    'id' => 'view_comment',
    'table' => 'comments',
    'field' => 'view_comment',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'timestamp' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 1,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'date_format' => 'raw time ago',
    'custom_date_format' => '2',
    'exclude' => 0,
    'id' => 'timestamp',
    'table' => 'comments',
    'field' => 'timestamp',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('sorts', array(
  'timestamp' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'timestamp',
    'table' => 'comments',
    'field' => 'timestamp',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Recent Comments');
$handler->override_option('use_ajax', TRUE);
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
$handler->override_option('row_options', array(
  'inline' => array(),
  'separator' => '',
  'hide_empty' => 0,
));
$handler = $view->new_display('block', 'TMA_reccom_Block', 'block_1');
$handler->override_option('block_description', 'TMA_reccom_b');
$handler->override_option('block_caching', '-1');

My other view causing me trouble is a recent tweets view. I've thought this might be an issue in the twitter module, but I've found that it does update the data of users tweets OK, it just doesn't show them, much like the comment view above doesn't find all recent comments.

$view = new view;
$view->name = 'adgrunt_tweets';
$view->description = 'adgrunts tweets';
$view->tag = 'tweets';
$view->view_php = '';
$view->base_table = 'twitter';
$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(
  'screen_name' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'http://twitter.com/[screen_name]',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 1,
    'id' => 'screen_name',
    'table' => 'twitter_account',
    'field' => 'screen_name',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'profile_image_url' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'http://twitter.com/[screen_name]',
      'link_class' => '',
      'alt' => 'twitterimage',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'profile_image_url',
    'table' => 'twitter_account',
    'field' => 'profile_image_url',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'text' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => 'http://twitter.com/[screen_name]',
      'link_class' => '',
      'alt' => 'twitterface',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_urls' => 1,
    'link_usernames' => 1,
    'link_hashtags' => 1,
    'hashtags_url' => 'http://search.twitter.com/search?q=%23',
    'exclude' => 0,
    'id' => 'text',
    'table' => 'twitter',
    'field' => 'text',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'name' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => 'adland',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'created_time' => array(
    'order' => 'DESC',
    'id' => 'created_time',
    'table' => 'twitter',
    'field' => 'created_time',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'screen_name' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => 'name',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'ignore',
    'glossary' => 0,
    'limit' => '0',
    'case' => 'none',
    'path_case' => 'none',
    'transform_dash' => 0,
    'id' => 'screen_name',
    'table' => 'twitter_account',
    'field' => 'screen_name',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '8' => 0,
      '4' => 0,
    ),
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'faq' => 0,
      'image' => 0,
      'product' => 0,
      'product_kit' => 0,
      'forum' => 0,
      'amazon' => 0,
      'commercials' => 0,
      'page' => 0,
      'print' => 0,
      'radio' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
      '4' => 0,
      '3' => 0,
      '2' => 0,
      '7' => 0,
      '5' => 0,
      '13' => 0,
      '12' => 0,
      '6' => 0,
      '78' => 0,
      '75' => 0,
      '76' => 0,
      '77' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
    'default_argument_image_size' => '_original',
    'image_size' => array(
      '_original' => '_original',
      'thumbnail' => 'thumbnail',
      'preview' => 'preview',
      'mik 40x40' => 'mik 40x40',
    ),
  ),
));
$handler->override_option('filters', array(
  'uid' => array(
    'operator' => 'not in',
    'value' => array(
      '0' => 0,
      '1' => '96730',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'uid',
    'table' => 'users',
    'field' => 'uid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'time',
  'results_lifespan' => '300',
  'output_lifespan' => '300',
));
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 0);
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 20);
$handler->override_option('use_pager', 'mini');
$handler->override_option('use_more', 1);
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'table');
$handler->override_option('row_options', array(
  'inline' => array(
    'text' => 'text',
  ),
  'separator' => '::',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
$handler->override_option('block_description', 'ADGRUNTWEETS');
$handler->override_option('block_caching', '4');
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('fields', array(
  'screen_name' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'http://twitter.com/[screen_name]',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 1,
    'id' => 'screen_name',
    'table' => 'twitter_account',
    'field' => 'screen_name',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'profile_image_url' => array(
    'label' => 'Twitter',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'http://twitter.com/[screen_name]',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '_blank',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'profile_image_url',
    'table' => 'twitter_account',
    'field' => 'profile_image_url',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'text' => array(
    'label' => 'Tweet',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_urls' => 1,
    'link_usernames' => 1,
    'link_hashtags' => 1,
    'hashtags_url' => 'http://search.twitter.com/search?q=%23',
    'exclude' => 0,
    'id' => 'text',
    'table' => 'twitter',
    'field' => 'text',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
  'name' => array(
    'label' => 'Adgrunt',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_user' => 1,
    'overwrite_anonymous' => 1,
    'anonymous_text' => 'adland',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('path', 'adgruntstweets');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));

Any ideas or pointers to where I might find the issue much appreciated.

Comments

Letharion’s picture

Status: Active » Fixed

Does it by any chance display 10 comments/20 tweets, since that's what you "Items to display" setting are?

Dabitch’s picture

It does display 10 comment / 20 tweets - but lets say I have five of my most recent comments on one node, it'll display one or three from that node, the rest from other nodes. Often there will be brand new comments on older posts (spammers!) that never display at all. I have to go through the admin-interface on a daily basis to find new comments and I was hoping that just glancing on this block would suffice.

I'm asking it to display most recent (right?) - and what I'm getting is a bit of a random display of the most recent comments.

comment
comment [not displaying]
comment
comment [not displaying]
comment
comment
comment
comment [not displaying]

Like that ^ it's not even logical like "it doesn't display every third new comment" or "It doesn't display comments that are replies to other comments". It just skips a bunch, seemingly at random.

Wish I could change the heading of this question now, as I see it's easily misunderstood.

I don't mean "show all the comments that exist at my site" I mean I'd like my view to show me the ten most recent comments, in order of posted date on the comment, and not randomly leave half of them out.

Dabitch’s picture

OK. I'm going to try this again.

I have six fresh comments today. They are the following (lets pretend).

#1
#2
#3
#4
#5
#6

In my recent comment box, these appear:

#3
#6

I hope that clarified what I mean is my problem, the recent comment box (and twitter) does not show all of the recent comments (LIMIT 10).

dawehner’s picture

Please select 'comment' as type of your view on admin/build/views/add

This probably will fix some of your problems.

Dabitch’s picture

aaaah. Well there you go, I had indeed missed something quite obvious.

When selecting comments as base table, I get all comments without any problems. Thanks for lending me your eyes!

I can't get the node title this way, so I'll do without. Twitter is another issue, the view itself seems fine.

merlinofchaos’s picture

To get the node title you merely have to add a relationship -- the 'recent comments' default view contains this relationship I believe.

Dabitch’s picture

Yes! Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.