views order hiba?

gdavid képe

Van egy helyes kis views-om, ami kivalogatja par szamomra fontos tartalom kozul azokat amik frissek, vagy van hozzajuk uj comment.

a gond az, hogy bar a views-ban be van allitva, hogy a rendezes last_comment_time desc legyen, megis a query-t asc kent rendezi.

kiexportaltam:
bocs, kicsit hosszu lett:

$view = new view;
$view->name = 'forum_top';
$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(
  'title' => array(
    'label' => 'téma',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 1,
      'max_length' => '27',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'last_comment_name' => array(
    'label' => 'utolsó hozzászóló',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '27',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_user' => TRUE,
    'exclude' => 0,
    'id' => 'last_comment_name',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_name',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'last_comment_timestamp' => array(
    'label' => 'beküldve',
    '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,
    ),
    'date_format' => 'time ago',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'relationship' => 'none',
  ),
  'new_comments' => array(
    'label' => 'újak',
    '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,
    ),
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => '.',
    'prefix' => '',
    'suffix' => ' új',
    'link_to_comment' => 1,
    'no_empty' => 1,
    'exclude' => 0,
    'id' => 'new_comments',
    'table' => 'node',
    'field' => 'new_comments',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'name' => array(
    'label' => 'forum',
    '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_taxonomy' => 1,
    'exclude' => 0,
    'id' => 'name',
    'table' => 'term_data',
    'field' => 'name',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'last_comment_timestamp' => array(
    'order' => 'DESC',
    'granularity' => 'minute',
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'blog' => 'blog',
      'poll' => 'poll',
      'forum' => 'forum',
    ),
    '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('use_ajax', TRUE);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'title' => 'title',
    'last_comment_name' => 'last_comment_name',
    'last_comment_timestamp' => 'last_comment_timestamp',
    'new_comments' => 'new_comments',
    'name' => 'name',
  ),
  'info' => array(
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'last_comment_name' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'last_comment_timestamp' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'new_comments' => array(
      'separator' => '',
    ),
    'name' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => 'last_comment_timestamp',
));
$handler = $view->new_display('block', 'Blokk', 'block_1');
$handler->override_option('block_description', 'forum_top');
$handler->override_option('block_caching', -1);

es a query amit general:

SELECT node.nid AS nid,
   node.title AS node_title,
   COALESCE(ncs_users.name, node_comment_statistics.last_comment_name) AS node_comment_statistics_last_comment_name,
   ncs_users.name AS ncs_users_name,
   node_comment_statistics.last_comment_uid AS node_comment_statistics_last_comment_uid,
   node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp,
   node.type AS node_type,
   term_data.name AS term_data_name,
   term_data.vid AS term_data_vid,
   term_data.tid AS term_data_tid
 FROM node node 
 INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid
 LEFT JOIN users ncs_users ON node_comment_statistics.last_comment_uid = ncs_users.uid AND ncs_users.uid != '0'
 LEFT JOIN term_node term_node ON node.vid = term_node.vid
 LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
 WHERE node.type in ('blog', 'poll', 'forum')
   ORDER BY node_comment_statistics_last_comment_timestamp ASC

most ez user error?
elore is koszonom a valaszokat.

ui: bocs a terjedelemert, csak nem tudtam filekent feltolteni az exportot

Melyik modulhoz, modulokhoz kapcsolódik a téma?: 
Drupal verzió: 
pp képe

Akkor vagy egy bug-ot fogtál, vagy hibáztál:

$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',

Ott a végén látható, hogy az asc. Ezt írd át desc-re és importáld vissza, talán.

pp

0
0
Pasqualle képe

ahogy pp irta, a tabla stilus megadasnal feluldefinialtad az alapertelmezett sorrendet..

0
0
gdavid képe

nem definialtam en sehol semmit felul. magatol csinalta. ellenben nektek koszonhetoen megoldodott a problemam. koszonom.

0
0
aboros képe

a legritkább esetben történnek "maguktól" a dolgok. a gép nem igazán szokott csak úgy magától átállítani ezt-azt. átálítottad azt te, legfeljebb nem emlékszel.

0
0

-
clear: both;

bunya képe

En is belefutottam hasonlo hibaba, kulonbozo views szuresek, rendezes nem megy normalisan a legutolso modulfrissites ote.

El van cseszve valami a lefrisebb stabil views es/vagy date modulban, dev verziot kellett feltennem.

0
0