I am working on my senior project and I am trying to implement Date Browser in Views but apparently there is an issue with Date API that is causing a number of errors. Also, I am no longer able to select my custom date field as an argument in Date Browser. I have run these errors by the maintainers of Views (http://drupal.org/node/1111146) and they have concluded that it must be an error within Date. You can view my site in which I am experiencing the errors live at bentsh.com/mission


The following are the errors I receive:

    Notice: Undefined index: group in _date_views_fields() (line 61 of C:\wamp\www\drupal7\sites\all\modules\date\date_views\includes\date_views_fields.inc).
    Notice: Undefined property: views_plugin_query_default::$fields in views_plugin_query_default->query() (line 1140 of C:\wamp\www\drupal7\sites\all\modules\views\plugins\views_plugin_query_default.inc).
    Warning: Invalid argument supplied for foreach() in views_plugin_query_default->compile_fields() (line 1058 of C:\wamp\www\drupal7\sites\all\modules\views\plugins\views_plugin_query_default.inc).
    Notice: Undefined property: views_plugin_query_default::$fields in views_plugin_query_default->query() (line 1140 of C:\wamp\www\drupal7\sites\all\modules\views\plugins\views_plugin_query_default.inc).
    Warning: Invalid argument supplied for foreach() in views_plugin_query_default->query() (line 1142 of C:\wamp\www\drupal7\sites\all\modules\views\plugins\views_plugin_query_default.inc).
    Warning: Invalid argument supplied for foreach() in views_plugin_query_default->compile_fields() (line 1058 of C:\wamp\www\drupal7\sites\all\modules\views\plugins\views_plugin_query_default.inc).
Debug:

'Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'FROM 
node node
LIMIT 10 OFFSET 0\' at line 1'

in views_plugin_query_default->execute() (line 1354 of C:\wamp\www\drupal7\sites\all\modules\views\plugins\views_plugin_query_default.inc).

Comments

karilu_ec’s picture

See how the notice in line 61 went away for me
http://drupal.org/node/1103790#comment-4291872

bentsh’s picture

Thanks, that fixed that single error, but the rest still remain.

cezaryrk’s picture

subscribe

cezaryrk’s picture

I added 2 lines after line 44 in date_navigation_plugin_style.inc and this solve the problem with the error message. The error occurse because no field is added for the SQL SELECT statement.

 // File date_views/includes/date_navigation_plugin_style.inc

  // (...)
class date_navigation_plugin_style extends views_plugin_style {
  // (...)

// Line: 43
  function query() {
    //$this->view->query->clear_fields();
   // ======
    $field_name = $this->view->query->count_field['field'];
    $this->view->query->fields[$field_name] = $this->view->query->count_field; // copy count_field declaration to fields
   // ======
    // Bring the argument information into the view so our theme can access it.
    $i = 0;    
    foreach ($this->view->argument as $id => $argument) {
  
   // (...)
}
damienmckenna’s picture

Just ran into this.

scthomps312’s picture

Subscribing

karens’s picture

Status: Active » Fixed

Lots of fixes to Date and Calendar since this report. It should be fixed with latest dev version of Date and latest Views.

karens’s picture

Status: Fixed » Active

Marked this fixed too soon, it is indeed still broken. Looking into this now.

karens’s picture

Step one, uncomment $this->view->query->clear_fields();

Still other errors tho.

karens’s picture

Status: Active » Fixed

I think I have this working right now. Ironically I had to clear fields to avoid one error and add a dummy field to avoid others, but it seems to be working right now.

Status: Fixed » Closed (fixed)

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

eglobal’s picture

I just updated date / calendar, added content for the first time. These are the new errors (not sure if the first one was there before?). They may all just be compatibility issues with the wrong version of views, but if not and so you have them.

Versions using:
Date: 7.x-2.0-alpha3 (this was the latest when I downloaded)
Calendar: 7.x-2.0-alpha1
Views: 7.x-3.0-beta3

New Errors:

# Strict warning: Declaration of views_handler_filter_user_name::value_submit() should be compatible with that of views_handler_filter_in_operator::value_submit() in _registry_check_code() (line 2789 of D:\Collaboration\Apache Software Foundation\Apache2.2\htdocs\drupal7\includes\bootstrap.inc).
# Notice: Undefined index: group in _date_views_fields() (line 73 of D:\Collaboration\Apache Software Foundation\Apache2.2\htdocs\drupal7\sites\all\modules\date\date_views\includes\date_views_fields.inc).
# Strict warning: Declaration of views_handler_filter_term_node_tid_depth::operator_options() should be compatible with that of views_handler_filter_in_operator::operator_options() in _registry_check_code() (line 2789 of D:\Collaboration\Apache Software Foundation\Apache2.2\htdocs\drupal7\includes\bootstrap.inc).
# Strict warning: Declaration of views_handler_filter_user_relationships_type::value_submit() should be compatible with that of views_handler_filter_in_operator::value_submit() in _registry_check_code() (line 2789 of D:\Collaboration\Apache Software Foundation\Apache2.2\htdocs\drupal7\includes\bootstrap.inc).
# Strict warning: Declaration of views_handler_filter_user_relationships_type::value_validate() should be compatible with that of views_handler_filter::value_validate() in _registry_check_code() (line 2789 of D:\Collaboration\Apache Software Foundation\Apache2.2\htdocs\drupal7\includes\bootstrap.inc).
# Strict warning: Creating default object from empty value in template_preprocess_calendar() (line 106 of D:\Collaboration\Apache Software Foundation\Apache2.2\htdocs\drupal7\sites\all\modules\calendar\theme\theme.inc).

paulgemini’s picture

@eglobal - I'd go with the latest dev releases of Calendar, Views, Ctools, and Date. Views just changed again yesterday and Ctools changed on May 18th... From the documentation:

IMPORTANT! The D7 version of Views and CTools (required by Views) are still under development and still undergoing changes that affect Date & Calendar functionality. Thus, all the Date & Calendar Views integration is in limbo while I chase those changes.

Until Views settles down, I cannot promise that any combination of Date, Calendar, Views, and CTools will work.
The best combination of modules is to use the -dev versions of Views, CTools, Date, & Calendar. Please don't report issues unless you have tried the latest current -dev versions of all these modules.