Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By marafa on
could someone please please review my code and tell me what is wrong? this is an export of a view i made
the objective was to find out how many nodes each user created by day/week individually. but neither the block nor the view itself will show up
$view = new stdClass();
$view->name = 'nodes_by_user';
$view->description = 'Nodes by user';
$view->access = array (
);
$view->view_args_php = '';
$view->block = TRUE;
$view->block_title = 'Nodes by user';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '';
$view->block_empty_format = '1';
$view->block_type = 'list';
$view->nodes_per_block = '10';
$view->block_more = TRUE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
);
$view->argument = array (
array (
'type' => 'year',
'argdefault' => '1',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'week',
'argdefault' => '5',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'users',
'field' => 'name',
'label' => 'Author Name',
'sortable' => '1',
'defaultsort' => 'ASC',
),
array (
'tablename' => 'node_counter',
'field' => 'daycount',
'label' => 'Recent Hits',
),
array (
'tablename' => 'node',
'field' => 'created',
'label' => 'Created Time',
'handler' => 'views_handler_field_date_small',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '\'1\'',
),
);
$view->exposed_filter = array (
);
$view->requires = array(users, node_counter, node);
$views[$view->name] = $view;
thanks for looking
Comments
watchdog shows this error
__________
http://namima.in-egypt.net اجدد اخبار ممثلين
http://www.echognumix.com
resolved
this problem was due to the fact that i wanted an expose filter but in the expose filter i did not have a default value.
it was resolved by selecting a default value. it will work without a default value but it will give the previous error.
___
http://namima.in-egypt.net
__________
http://namima.in-egypt.net اجدد اخبار ممثلين
http://www.echognumix.com