Views changed the way it defines Field data which broke the way it was implemented here. Views has changed quite a bit from the way it worked when I originally wrote the Date Views integration and I have been trying to just keep it as functional as possible while Views was still changing. I think the Views code is now pretty settled down and I probably need to completely rewrite the Date Views integration to work better with the way that Views now works.

I posted some commits to get around some errors, but it is basically pretty broken now and will be until I get a rewrite done.

CommentFileSizeAuthor
#13 working_view.jpg97.3 KBswitch
#13 broken_view.jpg99.69 KBswitch

Comments

rosborn’s picture

Thanks for the warning. I was about to start updating my website, which has been functional since just before Drupal 7 was officially released. Do you know when the incompatibility with the Date module first set in? Would it be safe to upgrade to Views-7.x-3.0-alpha1 from Jan 5 and Date 7.x-1.0-alpha1?

meigwil’s picture

Thanks for this.

I posted an issue about this on Views, and I was about to move it here when I read this.

Instead of creating a new issue, I'll x-post here. It may help you with your rewrite:

=================
Posted on http://drupal.org/node/1063936
=================

I have a content type with a title, datetime (Date module) and body field.

When creating a a calendar-like view, nothing is displayed if I choose the datetime field as a content type. I filtered on the node type, and ordered by the datetime field ASC. If I removed the datetime field from the Fields, it would show the content type (with the ORDER BY and filter in place).

Here is the SQL generated without the datetime field:

SELECT node.title AS node_title, node.nid AS nid, 'node' AS field_data_body_node_entity_type
FROM
{node} node
WHERE (( (node.type IN  ('eitem_calendr')) ))
LIMIT 10 OFFSET 0

Here's the SQL generated after adding the datetime field:

SELECT node.title AS node_title, node.nid AS nid, field_data_field_datetime.delta AS field_data_field_datetime_delta, field_data_field_datetime.language AS field_data_field_datetime_language, field_data_field_datetime.bundle AS field_data_field_datetime_bundle, field_data_field_datetime.field_datetime_value AS field_data_field_datetime_field_datetime_value, field_data_field_datetime.field_datetime_value2 AS field_data_field_datetime_field_datetime_value2, field_data_field_datetime.revision_id AS field_data_field_datetime_revision_id, 'node' AS field_data_body_node_entity_type, 'node' AS field_data_field_datetime_node_entity_type
FROM
{node} node
LEFT JOIN {field_data_field_datetime} field_data_field_datetime ON node.nid = field_data_field_datetime.entity_id AND (field_data_field_datetime.entity_type = :views_join_condition_0 AND field_data_field_datetime.deleted = :views_join_condition_1)
WHERE (( (node.type IN  ('eitem_calendr')) AND (field_data_field_datetime.language = 'en') ))
LIMIT 10 OFFSET 0

I'm very new to Drupal so I hope this is enough information. Please ask if you need anything else.

I'm using the 7.x-1.0-alpha2 version of Date.

=================

aanjaneyam’s picture

subscribing.

eugen80’s picture

subscribing

geve’s picture

Possibly related to this.

  1. Using dev versions of ctools,views,date,calendar,
  2. added a new content type using date tools wizard
  3. Enabled the Upcoming block

gives the following errors

Strict warning: Creating default object from empty value in date_views_filter_handler->init() (line 34 of /opt/lampp/htdocs/d7a/modules/date/date_views/includes/date_views_filter_handler.inc).
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_date.field_date' in 'where clause': SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} node LEFT JOIN {field_data_field_date} field_data_field_date ON node.nid = field_data_field_date.entity_id AND (field_data_field_date.entity_type = :views_join_condition_0 AND field_data_field_date.deleted = :views_join_condition_1) WHERE (( (node.status = :db_condition_placeholder_0) )AND( (DATE_FORMAT(CONVERT_TZ(field_data_field_date.field_date, 'UTC', 'Asia/Kolkata'), '%Y-%m-%d') >= '2011-02-22') ))) subquery; Array ( [:db_condition_placeholder_0] => 1 [:views_join_condition_0] => node [:views_join_condition_1] => 0 ) in views_plugin_pager->execute_count_query() (line 141 of /opt/lampp/htdocs/d7a/modules/views/plugins/views_plugin_pager.inc).

joostvdl’s picture

subscribe

sylvain lecoy’s picture

subscribing

kruser’s picture

I think this is related to my issue "Error using a cck date as an argument" http://drupal.org/node/1068698

maritimefist’s picture

subscribe

Renegadez’s picture

Sub in

dg0yt’s picture

subscribe

karens’s picture

I think the best solution is to rewrite the Views handling from the ground up. I have opened a new branch (7.x-2.x) and started work there to do this. See #1075896: Re-work Views arguments and #1075890: Re-work Views filters.

Views has changed significantly over the course of the time since these were first written, they really need a fresh look anyway.

When that seems solid, that branch will become the recommended release.

switch’s picture

Priority: Critical » Normal
StatusFileSize
new99.69 KB
new97.3 KB

If you don't mind I post here my example of View broken with Date field used in Fields. If you don't like it here feel free to delete this post. So I post it just in case you need more info about broken Views. Hope it's clear just by looking at the attached pics.

sebish’s picture

Subscribe

hansfn’s picture

Subscribe.

PS! Regarding the "Unknown column 'field_data_field_date.field_date'" error. I get it too - the correct column name is field_data_field_date.field_date_value. I guess this will be fixed by the re-write.

vqmalic’s picture

Subscribing

Same problem here where "_value" is missing from the sql statement

aanjaneyam’s picture

@KarenS. Does this means that we are unable to use date in views at all till the initial dev version of rewrite is complete. I am having a development installation where I need date views integration to accomplish my required views and calendar views. Should i start using date-7.x-2.x dated 28 February 2011. Even otherwise for future compatibility should we use 7.x-2.x for date uses other than views.

kirkcaraway’s picture

subscribing

eugen80’s picture

any temporary solution for this error?

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_event_date.field_event_date' in 'where clause': SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} node LEFT JOIN {field_data_field_event_date} field_data_field_event_date ON node.nid = field_data_field_event_date.entity_id AND (field_data_field_event_date.entity_type = :views_join_condition_0 AND field_data_field_event_date.deleted = :views_join_condition_1) WHERE (( (1=1) AND (field_data_field_event_date.language = :db_condition_placeholder_0) )AND( (DATE_FORMAT(ADDTIME(field_data_field_event_date.field_event_date, SEC_TO_TIME(3600)), '%Y-%m-%d') >= '2011-03-06') ))) subquery; Array ( [:db_condition_placeholder_0] => en [:views_join_condition_0] => node [:views_join_condition_1] => 0 ) in views_plugin_pager->execute_count_query() (line 140 of /var/www/vhosts/example.com/subdomains/dev/httpdocs/sites/all/modules/views/plugins/views_plugin_pager.inc).

draganeror’s picture

Subscribe

David D’s picture

Subscribe

meigwil’s picture

I've looked through Views' and Date's source but I can't see where they integrate with each other.

I'm experienced with PHP and want to contribute, so can anyone point me in the right direction? The problem that I have is using date as a field in a View.

WilliamV’s picture

When does dev-team can priovide a views-compatible module?
Grtz.

hieronymousch’s picture

subscribe

highfellow’s picture

subscribe.

TapioK’s picture

subscribe.

bradjones1’s picture

Subscribe

karens’s picture

Status: Active » Fixed

The new views handling is in the 7.x-2.x branch of Date. The Calendar module has not been completely updated to the new code yet.

basicmagic.net’s picture

subscribe

jamesnumiko’s picture

subscribe

karens’s picture

Umm, you guys are subscribing to a closed issue. Nothing more will happen here.

bryancasler’s picture

I upgraded to the latest views and date modules today, still getting a slew of line 252 errors.

Notice: Undefined index: additional fields in date_field_views_data_alter() (line 252 of...

Related conversation was happening here #1064134: Undefined index and array_merge errors when using latest views

karens’s picture

This is a closed issue. And if you are getting errors on line 252 there is something wrong with your installation. There is nothing like that on line 252 any more. Empty your date folder and get a fresh copy of everything.

bryancasler’s picture

I uninstalled the alpha 2 module and installed the current dev. No problems so far, will report back if they crop up.

zabelc’s picture

@KarenS, any chance we could get an alpha3 cut & recommended sometime?

Like animelion, I just got this issue because the auto-update task recommended I "upgrade" from dev to alpha2. I'm pretty sure this sort of thing happened to me a at least once before with this module as well...

Status: Fixed » Closed (fixed)

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