I don´t understand the sense of this behaviour.
Adding a Date field adds automatic a Language-Filter in the Where-Clause of the SQL-String.
Default Calendar View
SELECT node.nid AS nid, node_revision.timestamp AS node_revision_timestamp, 'node' AS field_data_body_node_entity_type
FROM
{node} node
LEFT JOIN {field_data_field_datum} field_data_field_datum ON node.nid = field_data_field_datum.entity_id AND (field_data_field_datum.entity_type = :views_join_condition_0 AND field_data_field_datum.deleted = :views_join_condition_1)
LEFT JOIN {node_revision} node_revision ON node.vid = node_revision.vid
WHERE (( (node.status = '1') )AND( (DATE_FORMAT(ADDTIME(STR_TO_DATE(field_data_field_datum.field_datum_value, '%Y-%m-%dT%T'), SEC_TO_TIME(3600)), '%Y-%m') = '2011-03') ))
Set Field to a Date Field (Adds language in Where-Clause)
SELECT node.nid AS nid, field_data_field_datum.delta AS field_data_field_datum_delta, field_data_field_datum.language AS field_data_field_datum_language, field_data_field_datum.bundle AS field_data_field_datum_bundle, field_data_field_datum.field_datum_value AS field_data_field_datum_field_datum_value, field_data_field_datum.revision_id AS field_data_field_datum_revision_id, 'node' AS field_data_body_node_entity_type, 'node' AS field_data_field_datum_node_entity_type
FROM
{node} node
LEFT JOIN {field_data_field_datum} field_data_field_datum ON node.nid = field_data_field_datum.entity_id AND (field_data_field_datum.entity_type = :views_join_condition_0 AND field_data_field_datum.deleted = :views_join_condition_1)
WHERE (( (node.status = '1') AND (field_data_field_datum.language = 'en') )AND( (DATE_FORMAT(ADDTIME(STR_TO_DATE(field_data_field_datum.field_datum_value, '%Y-%m-%dT%T'), SEC_TO_TIME(3600)), '%Y-%m') = '2011-03') ))
What does that mean for multi-language Sites?
That english people can only see english dates and german people only german dates while they use the same calendar?
Bug, Feature or PEBKAC?
Comments
Comment #1
lukspa commentedIts major bug, because each field you add to view adds own where statement in.e: AND (field_data_field_datum.language = 'en').
When some date fields in view are empty node record will be not returned, because there isn't specified field value entity with given language. Same if field has undefined language.
Comment #2
gerhardbaumeister commentedOK, lets call it a bug.
Comment #3
MichaelP commentedyep. seeing this too. Anyone got a quick and dirty workaround for a one language - not English - site?
Comment #4
a.siebel commentedsubscribe
Comment #5
gerhardbaumeister commented@clauded wrote in http://drupal.org/node/1094408#comment-4258154
If you have a multi-language site, you will have have to create one event for each language. So if your site is in english and german, you will create two events at the same date/time but in different language (this make sense if you want to display events in different language otherwise how do you translate this?). On the other hand, maybe an option in the calendar or the view module to ignore language would help...
Yes, a Option to save the Date-Content as undifined (language), and expanding the where-clause to
WHERE (( (node.status = '1') AND ((field_data_field_datum.language = 'en' OR field_data_field_datum.language = 'und')) ... should fulfill all requirements.
Comment #6
gerhardbaumeister commented@MichaelP
Yes, there is a workaround :-) elaborated by @syntax.
See http://drupal.org/node/1094408#comment-4259104
And avoid switching the default language to english. That was my fault to add date related content while i set the default language to english (for easier following the step by step guide). After changing to german all date related content disappears from the calender.
Comment #7
marcjpb commentedBeen trying to find way around this without any success but, if this help, the language in the where clause is the language of the current user.
Comment #8
Anonymous (not verified) commentedsubscribe
Comment #9
gagarine commentedduplicate of #1057544: Date field language handling problems