I'm not seeing the argument display in the summary for either a page or a block display. It seems to work fine with user info - as in the example on the help page. I went through that example step by step. (see: drupal/help/views/getting-started) Yet, with node info, and with a Date field as an argument, I only see list bullets with the count value () in text next to it. The link doesn't appear.

I've gone back and forth and have searched through bug issues with nothing found that can help me. I think it's a bug. If I come up with a workable solution, I'll post it here as well - unless one of you can get to it first! Thanks so much.

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

If you only read one of these submission guidelines, read this one. (Then please read the rest) If your problem deals exclusively with fields or filters provided by another module (CCK, Image, VotingAPI are common) please post the issue under the queue for that module first; all modules are responsible for telling Views about their own fields. It's possible Views IS at fault, but the module maintainers are the best people to make that determination, and they can kick the issue into the Views queue with an explanation of what's wrong if that is the case.

You're not being 100% clear here, so I quote the above as it appears that you're only seeing this problem with date fields. If you are, please read and follow the instructions. If not, please provide concise instructions for duplicating the problem you have.

merlinofchaos’s picture

I should also point to the 'archive' view (it's a default view that you can easily enable and use as an example) that functions with a basic node created field.

jefftrnr’s picture

Project: Views (for Drupal 7) » Date
Component: page displays » Code

I'm moving this to Date - Earl (merlinofchaos) is correct. The archive preset view works with the Argument Summary correctly.
MY problem happens when I select a Date for my argument and "Granularity" set to Year... the query is correct, but no link is displayed.

mike_r1977’s picture

Version: 6.x-2.0-rc2 » 6.x-2.0-rc3
Status: Postponed (maintainer needs more info) » Active

I'm experiencing this as well. Under Arguments, I choose Date: Date, then select my Date field with Granularity set to 'Year' and Method set to 'OR'. The display I chose was List. When I got to the section called Defaults: Configure summary style for Argument "Date: Date", I got these warnings:

warning: array_filter() [function.array-filter]: The first argument should be an array in [removed]\drupal\sites\all\modules\date\includes\date_api_argument_handler.inc on line 82.
warning: implode() [function.implode]: Invalid arguments passed in [removed]\drupal\includes\form.inc on line 829.
warning: array_filter() [function.array-filter]: The first argument should be an array in [removed]\drupal\sites\all\modules\date\includes\date_api_argument_handler.inc on line 89.

Needless to say, I get no year summary at all.

sonofmarx’s picture

I am recieving the exact same error.

warning: array_filter() [function.array-filter]: The first argument should be an array in [removed]\drupal\sites\all\modules\date\includes\date_api_argument_handler.inc on line 82.
warning: implode() [function.implode]: Invalid arguments passed in [removed]\drupal\includes\form.inc on line 829.
warning: array_filter() [function.array-filter]: The first argument should be an array in [removed]\drupal\sites\all\modules\date\includes\date_api_argument_handler.inc on line 89.

I've been attempting to create a summary with my granularity set to Month.

mike_r1977’s picture

Component: Code » Date API

Moving this to Date API since the error comes from there. Is there anything one could do to help? I can only test patches, but I'd gladly do it since I badly need this.

mike_r1977’s picture

This also happens with 6.x-2.x-dev.

rhache’s picture

I'm getting this error as well, but would like to point out that I get the error regardless of the settings I choose for granularity or method in views:

 * warning: array_filter() [function.array-filter]: The first argument should be an array in /Users/rhache/Sites/translation_test/sites/all/modules/date/includes/date_api_argument_handler.inc on line 82.
 * warning: implode() [function.implode]: Invalid arguments passed in /Users/rhache/Sites/translation_test/includes/form.inc on line 834.
 * warning: array_filter() [function.array-filter]: The first argument should be an array in /Users/rhache/Sites/translation_test/sites/all/modules/date/includes/date_api_argument_handler.inc on line 89

I would be willing to help with any kind of testing that is required to help move this along.

Sincerely,
Rene

mike_r1977’s picture

Version: 6.x-2.0-rc3 » 6.x-2.0-rc4

This still happens with 6.x-2.0-rc4.

mike_r1977’s picture

I'm not familiar with Date API, so please forgive me if I'm saying something obvious or downright stupid, but I really need this, so I tried a bit of debugging. These are the problematic lines:

  function options_validate($form, &$form_state) {
    $check_fields = array_filter($form_state['values']['options']['date_fields']);
    if (empty($check_fields)) {
      form_error($form['date_fields'], t('You must select at least one date field for this argument.'));
    }
  }
  
  function options_submit($form, &$form_state) {
    $form_state['values']['options']['date_fields'] = array_filter($form_state['values']['options']['date_fields']);
  }

I added a basic:

form_error($form['date_fields'], $form_state['values']['options']['date_fields'] . "options_validate");

before line 82 (the $check_fields up there) and when clicking on the Update button on the first Defaults: Configure Argument "Date: Date" I got Array.

Next I removed that error message line and put it again before line 89 (that is to say before $form_state['values']['options']['date_fields'] = array_filter($form_state['values']['options']['date_fields']) ).
On the first screen, no message; I click update and I get again Array on the Change summary style for Argument "Date: Date" screen.

If I remove the error line and click update, then I get the warning messages that stops the view from working, almost as if the array wasn't passed from the second to the third screen.

I have no idea if this is useful or pointless, but I thought I'd share in case someone else can shed more light on this issue.

karens’s picture

Status: Active » Postponed (maintainer needs more info)

This message indicates that there is no array of date fields in the form, and there should be no way that can happen. Edit the date argument and see if it is showing you a list of possible date fields with checkboxes next to each one. Do you see that list? If so, you have an array being passed to the validation.

I can't replicate this at all, so lets start by confirming that the array of date fields shows up in the argument settings.

mike_r1977’s picture

Status: Postponed (maintainer needs more info) » Active

First of all, thank you Karen for taking the time to reply.

Yes, I do get the list of date fields with checkboxes next to each one. The error is not there, but later in the process. Everything seems to be working perfectly up until the third screen called: Defaults: Configure summary style for Argument Date: Date, where I'm asked:

Display record count with link
Override number of items to display

It's above these options that I get the dreaded error message.

I can replicate this error on a fresh installation of Drupal 6.5, with only the latest CCK, Views and Date module installed. I don't know if it helps, but this is the test view I created on this fresh installation and that gives me the same error (and, most importantly, no summary):

$view = new view;
$view->name = 'test';
$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' => 'Title',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'title' => array(
    'order' => 'ASC',
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'date_argument' => array(
    'default_action' => 'summary asc',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 0,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => 'test',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'date_fields' => array(
      'node_data_field_test.field_test_value' => 'node_data_field_test.field_test_value',
    ),
    'date_method' => 'OR',
    'granularity' => 'year',
    'id' => 'date_argument',
    'table' => 'node',
    'field' => 'date_argument',
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'page' => 0,
      'story' => 0,
      'test' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(),
    'validate_argument_type' => 'tid',
    'validate_argument_php' => '',
  ),
));
$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',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
karens’s picture

That's the problem then, you're choosing to display a summary instead of supplying a default value, but I've been testing a different path, where I set the argument up to provide a default date.

Now that I know what you're doing to get the error, I can see if I can reproduce it and find the best fix.

mike_r1977’s picture

[Edited to add more details]
The probably related patch here helps, but does not fix the problem with argument summaries: I still get exactly the same warning messages, but this time I do get a summary: unfortunately, instead of having:

  • 2006
  • 2007
  • 2008

linked to the page view with the added argument as I was expecting, I get instead:

  • 2008
  • 2008
  • 2008

linked to the page view, without the added argument.

[Edited to add even more details]
Since the patch now allows the query to be generated, I ran it directly in my database and I got the correct years (2006, 2007, 2008).

batbug2’s picture

mike_r1977, i second that, i have exactly the same problem

cindyr’s picture

Any progress on this? I've just started using this, and I'm getting the same errors (#8) in the same situation (#12) using 6.2-2.0-rc4...

giorgosk’s picture

Had exactly same problem
6.x-2.x-dev solves the problem partially

I can see the summary page
but then when I click on the 2008 to see nodes for that year
I get page not found and this error message

Fatal error: Cannot break/continue 1 level in C:\test\tmod\sites\all\modules\date\includes\date_api_argument_handler.inc on line 321
giorgosk’s picture

Version: 6.x-2.0-rc4 » 6.x-2.x-dev

The DEV is actually working correctly

the previous problem was that the
date range on the argument was too restrictive -3 - +3
for the range that I had set for my CCK field

isn't there a way to grab the date range from the CCK field as default ?

ar-jan’s picture

Status: Fixed » Active

What is the latest status on this issue? I am using rc6 and I do not get any of the errors mentioned before, but it does seem something isn't right using summary views of date fields.

When I make a Views block, choose a cck date field as argument, granularity year, and 'Summary, sorted descending', and use the list style, I do get a list but not a summary:

In my case I have 5 nodes with the year 2008 in their date field, the 'summary' view (with record count) produces this:
* 2008 (1)
* 2008 (1)
* 2008 (1)
* 2008 (1)
* 2008 (1)

Instead of
* 2008 (5)

This looks related to the problems mentioned before. Re http://drupal.org/node/307256#comment-1062474 : are there known problems using summary with date fields?
(If this is actually not a date/views problem but my mistake, apologies).

rig’s picture

i have exactly the same problem!!!

rhache’s picture

A colleague of mine and myself have also encountered the same problem when setting a date argument summary granularity to "year". Each month gets its own line.

I've tried both the dev and rc6 release on Drupal 6.8 with Views 2.2.

Sincerely,
Rene

gmreed’s picture

Subscribe. (aka Colleague - posted same issue to Views: http://drupal.org/node/364444 - apologies for having created a duplicate)

Crell’s picture

I think the root cause is here: #342224: Summary, sorted ascending/descending Views by Date don't work

Not marking this as a duplicate just yet, but I suspect it is.

karens’s picture

Status: Active » Fixed

I just posted a change to the argument summary that seems to help get it to group by date and granularity properly and the sorting also works correctly for me. Some of the Views code changed and that changed the way the Date argument needed to react.

If there are problems in the latest -dev code you can reopen.

Status: Fixed » Closed (fixed)

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

designcontext’s picture

I've got the problem with the 7.2

Fajan’s picture

Status: Closed (fixed) » Active

I also got the same problem on 7.4 with dev versions of Views, Date and Entity. I have submitted a bug report on this a week ago here... #1207540: Inappropriately ungrouped display summary of content date field. (Am not duplicating that one yet cos I think this bug is specific to the 7.x-dev trunk.)

Fajan’s picture

Status: Active » Fixed

Bug has been fixed in 7.x dev.

Status: Active » Closed (fixed)

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