I am creating an event calendar for school sporting events in the local area and am just having problems trying to find a solution to the following. Some of the events in the calendar will be the same but will happen on different dates and at different venues and times

e.g - Primary School Football Competition - 12/01/2012 - 16.00-17.30 at Venue A, 15/01/2012 - 13:00-15:00 at Venue B, 27/02/2012 16:00-17:30 at Venue C.

I am just wanting a way of creating an event and being able to add 3 or 4 dates to that particular event with different venues and times without having to create a new event page for each of them as all the event rules and details are the same for all. Is this possible? Any help would be much appreciated.

Comments

iancartwright’s picture

Assigned: iancartwright » Unassigned
er_gaurav_sharma’s picture

Yes, ofcourse it's very simple, you need to use field collection field module for drupal 7. It's a module that makes composite field. You can make field that contain date field and venu field. Make that field multivalue in field setting as usual. And add that field to node you want to use for events.

iancartwright’s picture

Thanks for the reply.
I'm obviously doing something wrong because when I try to save the event page the following comes up.

Fatal error: Cannot access empty property in C:\wamp\www\drupal-7.10\sites\all\modules\calendar\includes\calendar_plugin_row_node.inc on line 291

I have done the following.
1. Downloaded the field collection field module as you said.
2. Created a content type called Calendar Page which I have added an 'event_details' field to - this is a Field-collection field which is set to have unlimited values
3. Gone to structure/field-collections/event_details and added an 'event_date' field and an 'event_venue' field which are both also set to unlimited values
4. Created a new content page (Calendar Page Content Type) and added all the information. Then when I save the above error comes up.

When I click back in the browser to go back to the content page in admin the following error is there

Notice: Undefined property: date_sql_handler::$placeholders in date_views_plugin_pager->query() (line 161 of C:\wamp\www\drupal-7.10\sites\all\modules\date\date_views\includes\date_views_plugin_pager.inc).
Notice: Undefined index: field_data_field_event_date.field_event_date_value in calendar_plugin_row_node->pre_render() (line 246 of C:\wamp\www\drupal-7.10\sites\all\modules\calendar\includes\calendar_plugin_row_node.inc).

I assume that I have missed something or set up the fields/module wrong. Apologies if this is really obvious to solve but I am new to using Drupal and still learning.

er_gaurav_sharma’s picture

your third step is wrong don't make 'event_date' and 'event_venue' field to multivalue or umlimited.

er_gaurav_sharma’s picture

one more thing i am telling you this is not an error. This is just a notice due to bad php programming and it is minor it won't affect your business workflow. So feel free to try on views for listing of your events. If you get succeeded do reply me.

iancartwright’s picture

Thanks. I've got it working now. The only issue is that when in calendar views I can only get the events to show when the contextual filter is set to updated date. I've got the upcoming events list working fine but I'm wanting to show the events in the other calendar views if possible.

makt’s picture

I'm stuck where you are iancartwright. Please let me know if you find a solution to the problem. My lists of events are working perfectly, but my monthly calender is not.

pbfleetwood’s picture

Has anyone tried this with the 7.x-3.x-dev version of the module? I'm curious whether that makes a difference with this issue.

makt’s picture

I just tried using the 7.x-3.x-dev version and I got the same result.

Once I move the date field to a field collection, I don't have the option of selecting the right date field as a contextual filter.

er_gaurav_sharma’s picture

for this you have to get the date field from field collection field by using relationship in views.

makt’s picture

Ok. I'm one step closer but still out of reach from my end goal!

After I added the relationship in views, I have 4 field collection options to choose from:
-Field-collection item: Event Date (field_event_date:delta)
-Field-collection item: Event Date (field_event_date:rrule)
-Field-collection item: Event Date - start date (field_event_date)
-Field-collection item: Event Date - end date (field_event_date:value2)

Only the start and end date have an option to create a default value of Current Date. So I selected start date and this is the error that pops up:

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 ' '%Y-%m') >= '2011-12' AND DATE_FORMAT(, '%Y-%m') <= '2011-12') )) ORDER BY fiel' at line 4

Should I revert back to the alpha version of this module or am I configuring the view wrong?

er_gaurav_sharma’s picture

are you using the latest stable release of date + calendar + views (not dev)?

makt’s picture

I just reverted my calendar module back to the stable release, and also reverted the default calendar view that ships with the module. I configured the view to use the field collection start date again and the same error popped up.

So I guess it must be something to do with the module or how I'm configuring the view.

iancartwright’s picture

How do you go about creating the relationship with the field collection field? If I had a field collection of 'event_details' with a field of 'event_date' in the field collection how would I create the relationship so that it showed up in the contextual filter?

I've created a relationship with 'event_details' but it does not seem to change anything or add any extra selections so I assume I am doing something wrong.

iancartwright’s picture

I got the relationship to appear in the contextual filter but the following came up after I had selected it

An AJAX HTTP error occurred
HTTP Result Code:200
Debugging information follows.
Path: /drupal-7.10-1/admin/structure/views/view/calendar/previews/page_1/ajax

StatusText:OK
ResponseText:
(!) Fatal error: Cannot access empty property in c:\wamp\www\drupal-7.10-1\sites\all\modules\calendar\includes\calendar_plugin_row_node.inc on line 291
Call Stack
#TimeMemoryFunctionLocation
10.0003759040{main}( )..\index.php:0
20.249634916640menu_execute_active_handler( )..\index.php:21
30.258636939408call_user_func_array ( )..\menu.inc:503
40.258636939408views_ui_build_preview()..\menu.inc:503
50.268337446952views_ui_preview( )..\admin.inc:952
60.353445610944view->preview( )..\admin.inc:175
70.355745778800views_plugin_display->preview( )..\view.inc:1121
80.355745778848view->render( )..\views_plugin_display.inc:2536
90.474047245384views_plugin_display->render( )..\view.inc:1035
100.476647670880theme( )..\views_plugin_display.inc:2468
110.477147678048template_preprocess_views_view( )..\theme.inc:993
120.477147678048calendar_plugin_style->render( )..\theme.inc:51
130.478347687760calendar_plugin_row_node->render( )..\calendar_plugin_style.inc:280

makt’s picture

Has anyone found a solution to this issue? Or have another idea on how to solve the problem?

I've gone through all of the solutions I can think of (within my skillset) and I can't seem to think of anything else...

KarenS’s picture

Status: Active » Closed (duplicate)

It looks like this is a question about using dates in a field collection, which is a duplicate of #1211842: Display date in field collection in a calendar.

Jānis Bebrītis’s picture

I solved this issue without any coding involved. I got my hands dirty and started to play around with views_plugin_row handler, but then I realised it's not needed as module itself is looking for delta.

  • first, edit node fields and make date field multivalue. existing data will be saved.
  • edit node, set multiple dates for it. just to test the result.
  • edit calendar view, in case you have set it select distinct items, untick checkbox. You want multiple entries to appear. all dates appear on first day now.
  • add that date field as an extra field in view and make it hidden ("do not display"). This way delta is returned for views handler. Do this for every display you need to.

et voila, multiple dates appear correctly in calendar now. Hopefully this helps someone as I spent few hours on this simple solution.

symphonia’s picture

Hello... I have a similar problem: I've created a field collection with 2 fields in it (date of event & place of event). I need to create several events with same name but different date and place.

In my calendar view I set up the field collection under FIELDS, but those fields in calendar don't show up....

can you help me please?