d7-dev (2011-Mar-28)
Date 7.x-2.x-dev (2011-Mar-28)
Views 7.x-3.x-dev (2011-Apr-02)

I made a current user View with a relationship of created nodes. I'm just getting the count of the nodes. Im using Date as a Contextual Filter for my relationship node and have the default set to Current date and Granularity set to Day.

Under "Date field(s)" it has User values and no Node values.

What I'm trying to do is have blocks with a count of nodes that the user created today, this week, this month, this year. But I can't when the relationship is recognized but the Date field(s) don't list any node data.

CommentFileSizeAuthor
#3 date.jpg101.19 KBokletsgo
#3 date2.jpg103.72 KBokletsgo

Comments

TimelessDomain’s picture

My Date Fields are missing from my Contextual FIlters as well.

I had originally installed 1x Calendar & Date, but then uninstalled them completely & installed the 2x versions. Everything seems to be working fine except for the problem outlined above.

A related issue #1103564: No CCK date fields in Contextual filters after local translation is installed is having the same problem, but with translations. I do not have any translations.

I have tried date & datetime fields. All widget styles (from select list to date pup-up with repeat options), yet nothing works.

ctools 7.x-1.x-dev

views 7.x-3.x-dev

date 7.x-2.x-dev

calendar 7.x-2.x-dev

TimelessDomain’s picture

Applying patch from https://drupal.org/node/1103790#comment-4306414 fixed my problem

okletsgo’s picture

StatusFileSize
new103.72 KB
new101.19 KB

Patch/updated dev didn't fix my problem, thanks though. I'll try to clarify...

This is what I have:
- View "Type: User"
- Relationship "User: Content authored"
- Contextual Filters "(nodes) Date: Date (node) (User: Created date)

Now with that contextual filter theres "Date field(s)". Usually it has "Node" options but it doesn't under the View type User. Shouldn't it have "Node" type options since I'm using the "nodes" Relationship?

I've attached 2 images. First being type: User without Content: Post date etc. and second image being type: Node with the fields.

$view = new view;
$view->name = 'thot_counter';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'users';
$view->human_name = 'THOT Counter';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'THOT Counter';
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'access user profiles';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '0';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: User: Content authored */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'users';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
$handler->display->display_options['relationships']['uid']['required'] = 0;
/* Field: Content: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['relationship'] = 'uid';
$handler->display->display_options['fields']['nid']['group_type'] = 'count';
$handler->display->display_options['fields']['nid']['label'] = '';
$handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['nid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['nid']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['nid']['alter']['external'] = 0;
$handler->display->display_options['fields']['nid']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['nid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['nid']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['nid']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['nid']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['nid']['alter']['html'] = 0;
$handler->display->display_options['fields']['nid']['element_label_colon'] = 0;
$handler->display->display_options['fields']['nid']['element_default_classes'] = 1;
$handler->display->display_options['fields']['nid']['hide_empty'] = 0;
$handler->display->display_options['fields']['nid']['empty_zero'] = 0;
$handler->display->display_options['fields']['nid']['link_to_node'] = 0;
/* Sort criterion: User: Created date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'users';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Contextual filter: Date: Date (node) */
$handler->display->display_options['arguments']['date_argument']['id'] = 'date_argument';
$handler->display->display_options['arguments']['date_argument']['table'] = 'node';
$handler->display->display_options['arguments']['date_argument']['field'] = 'date_argument';
$handler->display->display_options['arguments']['date_argument']['relationship'] = 'uid';
$handler->display->display_options['arguments']['date_argument']['default_action'] = 'default';
$handler->display->display_options['arguments']['date_argument']['default_argument_type'] = 'date';
$handler->display->display_options['arguments']['date_argument']['default_argument_skip_url'] = 0;
$handler->display->display_options['arguments']['date_argument']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['date_argument']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['date_argument']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['date_argument']['year_range'] = '-3:+3';
$handler->display->display_options['arguments']['date_argument']['granularity'] = 'day';
$handler->display->display_options['arguments']['date_argument']['date_fields'] = array(
  'users.created' => 'users.created',
);
$handler->display->display_options['arguments']['date_argument']['date_method'] = 'OR';
$handler->display->display_options['arguments']['date_argument']['date_group'] = 'date';
/* Filter criterion: User: Active */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'users';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: User: Current */
$handler->display->display_options['filters']['uid_current']['id'] = 'uid_current';
$handler->display->display_options['filters']['uid_current']['table'] = 'users';
$handler->display->display_options['filters']['uid_current']['field'] = 'uid_current';
$handler->display->display_options['filters']['uid_current']['value'] = '1';

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$translatables['thot_counter'] = array(
  t('Master'),
  t('THOT Counter'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Items per page'),
  t('- All -'),
  t('Offset'),
  t('nodes'),
  t('All'),
  t('Block'),
);
okletsgo’s picture

I'm guessing something needs to be fixed in date_views\includes\date_views_argument_handler.inc starting on line 55


  /**
   * Add a form element to select date_fields for this argument.
   */
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $fields = date_views_fields($this->view->base_table);
    $options = array();
    foreach ($fields['name'] as $name => $field) {
      $options[$name] = $field['label'];
    }

    $form['date_fields'] = array(
      '#title' => t('Date field(s)'),
      '#type' => 'checkboxes',
      '#options' => $options,
      '#default_value' => $this->options['date_fields'],
      '#multiple' => TRUE,
      '#description' => t("Select one or more date fields to filter with this argument. Do not select both the 'From date' and 'To date' for date fields, only one of them is needed."),
    );

enxox’s picture

some issue here

kreynen’s picture

Using a current dev of Date with Views-7.x-3.0-beta3 solves this issues.

http://drupal.org/node/1103790#comment-4306414 fixes the issue with more recent versions of Views, but #1126650: Date fix for #1115442 causes problems with Calendar.

karens’s picture

Status: Active » Fixed

This should be working right with latest -dev version of Date.

Status: Fixed » Closed (fixed)

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