Not having any success getting both fields to work in concert in a contextual filter. I've tried adding both fields into the same filter and also attempted creating 2 separate filters for each field.

I can get each field working correctly by itself but doing a combination of the two fails. Any ideas?

Comments

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

You need them to be in the same filter. I have no idea what you mean by 'not having success'. You will have to provide a lot more information for me to have any idea what you have done and what you thought would happen and what did happen.

cossovich’s picture

I have a content type with 2 date fields:

Date field no.1
Number of values: unlimited; Collect an end date: false;
Date field no.2
Number of values: 1; Collect an end date: true;

If I only use one of the date fields in the contextual filter for the calendar view, the content is displayed in the calendar correctly. If I add both date fields into the contextual filter, no content is displayed.

KarenS’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sounds like you have them set up with 'AND' and you should change them to use 'OR'. You can control that if you add both of them to the same filter. If you set them up as separate filters they will always use 'AND' and you will only see items where both dates match the criteria.

Status: Fixed » Closed (fixed)

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

skyredwang’s picture

Category: support » bug
Priority: Normal » Critical
Status: Closed (fixed) » Active

I have exact the same problem as #2, and have used 'OR' as the operator; but no content display.

I use the generated query from Views, and dump it into mysql, the result is not null.

The tested version was head on Aug.24th

skyredwang’s picture

also received this warning

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in calendar_plugin_row_node->render() (line 317 of /data/disk/dev/static/dev.windhorsetour.com/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
seddonym’s picture

Tested dev today, same problem here with two date fields on different content types.

ilovetoast’s picture

I am experiencing the same problem. I am using both dev's up to date.

I have two different date fields in different content types. Works fine with one date. I have tried every-combination of and/or, adding separate contextual filter and both dates in one filter. Cleared the cache a lot, No luck. I received no error, the month display just has no content in it.

cossovich’s picture

@skyredwang I was also using the 'OR' operator when I posted my comment in #2... I eventually gave up on pursuing this particular view and went back to a single date field. I didn't have time to look into the date_views code but I suspect have two date fields with such different configuration as the arguments isn't supported.

David D’s picture

I'm also running into this problem (same as #8). I'm using 7.x-3.x-dev (2011-Sep-06). With my Contextual Filters set to "Date: Date (node) (Content: Meeting Date & Time (field_meetdate) OR Content: Show date(s) - start date (field_show))", I get nothing. Deselecting either of the fields in the contextual filter will restore the display of the other event.

David D’s picture

Darn! I just noticed that I unintentionally created a new revision of the Issue Summary here when I commented previously. I did the same thing just now in another issue here. I don't know what I'm doing to cause this!

EDIT

Nevermind. I see this happens to everyone.

ccurwen’s picture

subscribe

chemicalroman’s picture

subscribe

dps_addesign’s picture

Component: User interface » Code

Also trying to set up a calendar view with 2 contextual filters for two node types with different "date" fields. One has "end date", the other doesn't.
These errors show up:

Notice: Undefined property: stdClass::$field_date in calendar_plugin_row_node->render() (line 291 of /sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
Warning: array_key_exists() expects parameter 2 to be array, null given in calendar_plugin_row_node->render() (line 306 of /sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
Warning: Invalid argument supplied for foreach() in calendar_plugin_style->render() (line 280 of
/sites/all/modules/calendar/includes/calendar_plugin_style.inc).

amir_razavi’s picture

Assigned: Unassigned » amir_razavi

suffer the same problem!

amcc’s picture

if i have more than one type of date selected in the contextual filter i get the following errors. I have the latest devs of calendar, date and views

    * Notice: Undefined property: stdClass::$field_trip_date in calendar_plugin_row_node->render() (line 299 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: array_key_exists() expects parameter 2 to be array, null given in calendar_plugin_row_node->render() (line 314 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: Invalid argument supplied for foreach() in calendar_plugin_style->render() (line 286 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_style.inc).
    * Notice: Undefined property: stdClass::$field_trip_date in calendar_plugin_row_node->render() (line 299 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: array_key_exists() expects parameter 2 to be array, null given in calendar_plugin_row_node->render() (line 314 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: Invalid argument supplied for foreach() in calendar_plugin_style->render() (line 286 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_style.inc).
    * Notice: Undefined property: stdClass::$field_trip_date in calendar_plugin_row_node->render() (line 299 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: array_key_exists() expects parameter 2 to be array, null given in calendar_plugin_row_node->render() (line 314 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: Invalid argument supplied for foreach() in calendar_plugin_style->render() (line 286 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_style.inc).
    * Notice: Undefined property: stdClass::$field_club_date in calendar_plugin_row_node->render() (line 299 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: array_key_exists() expects parameter 2 to be array, null given in calendar_plugin_row_node->render() (line 314 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc).
    * Warning: Invalid argument supplied for foreach() in calendar_plugin_style->render() (line 286 of /Users/alistairmcclymont/Sites/dl7/sites/all/modules/calendar/includes/calendar_plugin_style.inc).
amir_razavi’s picture

I am wondering what has happened with this issue! At the moment I am using "Full Calendar" (because it supports more than one date field for the calendar)! But if this issue solves, I would like to use this module!

KarenS’s picture

Status: Active » Fixed

I cannot replicate any problem using two different date fields in the same contextual filter. If I join them using OR, any fields that meet either criteria show up in the view.

There must be something else in the view besides that one thing. Or else the problems have been since fixed in later versions of the code.

Get the very latest development versions of both Date and Calendar and clear all your caches. Also edit and re-save your view. If you still have problems you can reopen, but I need more information about exactly how the fields are configured and how the view is set up.

KarenS’s picture

Status: Fixed » Active

I was thrown off track by the reports of error messages. I see no error messages in the latest code but I do see that the dates are not getting displayed in the calendar. So that is still an issue and I can replicate it.

KarenS’s picture

Status: Active » Fixed

OK, I found the problem, some bad logic that returned if the value was missing instead of continuing to process the other fields.

http://drupalcode.org/project/calendar.git/commit/f6ca42b

Status: Fixed » Closed (fixed)

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

Canadaka’s picture

Version: 7.x-3.x-dev » 7.x-3.0-rc1

I'm still not able to show nodes that use different date fields on the same calendar. I get no errors but only 1 of the node/field types show. I have OR selected in the contextual settings. I tried the commit above but the RC1 version is much newer.

lupuz’s picture

Version: 7.x-3.0-rc1 » 7.x-3.4
Status: Closed (fixed) » Active

I'm still having problems with multiple date fields in contextual filters.

In mini-calendar, when it first loads, the events show fine. But when use the pager to show the next month only first day of the month is highlighted with an event (also when that day don't have one).

I've seen that when events are loaded (in calendar_plugin_row::pre_render()) the $values array is not the events from the next month, they are from current. As a result, the array to be rendered have only 1 item $array[2012-MM-01][00:00:00] with all the events inside.

lupuz’s picture

Status: Active » Closed (fixed)

Seems to be solved with last Date API update.