Upon upgrading to 2.7 I noticed a block I created to sort descending based on the days hits did not do so any more. I can't really tell at all the sort order by looking at it.
One curious thing, when I am on the Referrers page and looking at it based on descending by date (most recent referrals at the top), then the "Today’s Most Viewed" block does sort properly. Curious. This is the page: www.example.com/admin/reports/referrers?sort=desc&order=Last+visit
But on every other page it sorts in some way I can't tell. I have other blocks but they are behaving correctly, some blocks that sort reverse chronological, and a block that sorts based on total number of hits.
So obviously I cleared the View's cache (although I just noticed this particular block is set to not cache) and Drupal caches quite a few times. I also scrapped the sort order from the view, saved, and added it back, just in case there was something goofed up in that regard, but it still didn't fix the problem.
When I look at the view in the Edit page, I see it's not sorting properly, here is the query:
SELECT node.nid AS nid,
node.title AS node_title,
node_counter.daycount AS node_counter_daycount
FROM node node
LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid
WHERE (node.status <> 0) AND (node_counter.daycount > 0)Here is the view exported:
$view = new view;
$view->name = 'popular_today';
$view->description = 'List of popular nodes today.';
$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', 'Today’s Most Viewed', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'daycount' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
'id' => 'daycount',
'table' => 'node_counter',
'field' => 'daycount',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'daycount' => array(
'order' => 'DESC',
'id' => 'daycount',
'table' => 'node_counter',
'field' => 'daycount',
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'daycount' => array(
'operator' => '>',
'value' => array(
'value' => '0',
'min' => '',
'max' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'daycount',
'table' => 'node_counter',
'field' => 'daycount',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Today’s Most Viewed');
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 0);
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 7);
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', NULL);
$handler->override_option('exposed_block', TRUE);
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
Comments
Comment #1
dawehnerDid you tryed out the 2.x-dev of views?
The problem was fixed with http://drupalcode.org/viewvc/drupal/contributions/modules/views/plugins/...
Comment #2
Bairnsfather commentedI haven't yet. I thought I searched the issue queue well enough to see if this issue'd been raised, sorry I missed it.
It appears I can just patch and not have to run update.php?
Thanks.
Comment #3
merlinofchaos commentedActual issue is here: http://drupal.org/node/622602
Comment #4
Bairnsfather commentedThanks dereine, that seems to have done the trick.
Comment #5
Bairnsfather commentedComment #6
Bairnsfather commentedOops, sorry Mr. Merlin, we seemed to have been typing at the same time. :-) I guess that'll teach me to reload the web page before I write up my latest thoughts.
Comment #7
merlinofchaos commentedNo worries, crossposting happens.