I am new to both Drupal and CiviCRM, and am probably in way over my head. So far so good though - I have successfully installed both, and most everything is working OK. When creating events though in the events module, and then viewing the calendar, I get the following error message relating to event starting and ending times:
Notice: Undefined property: CRM_Core_DAO::$start_date in events_calendar() (line 146 of home/humboldt/public_html/drupal/sites/all/modules/civicrm_events-7.x-1.2/civicrm_events/civicrm_events.module).
Notice: Undefined property: CRM_Core_DAO::$end_date in events_calendar() (line 147 of /home/humboldt/public_html/drupal/sites/all/modules/civicrm_events-7.x-1.2/civicrm_events/civicrm_events.module).
I think they relate to the following code, but I don't know what to fix. Help would be appreciated. Thx.
while ( $dao->fetch( ) ) {
if ( $dao->title ) {
$startDate = date("Y,n,j", strtotime( $dao->start_date ) );
$endDate = date("Y,n,j", strtotime( $dao->end_date ) );
$dao->url = CRM_Utils_System::url( 'civicrm/event/info', 'id=' . $dao->id );
Comments
Comment #1
xanxano commentedHi, I have the same problem, i'm also looking for solutions. Thanks.
Comment #2
xanxano commentedI solved the problem for me... i don't know exactly what i ido but it works. I only deleted the "strtotime"
bye! :)
Comment #3
flexator commentedThat didn't help me to fix it.
Comment #4
flexator commentedanyone has another idea ?
Comment #5
GrumpusNation commentedprint_r($dao) reports that the properties start_date and end_date are actually just $dao->start and $dao->end; to be safe, I adjusted the module thusly:
Errors gone.
Comment #6
bcobin commented#2 worked for me - wasn't sure exactly where to paste the code in #5 and when #2 worked, I punted.
Currently Civi calendars in D7 are a major problem - would love to see more development here, especially when it comes to views integration!
Thanks for the module and for the fix here... rock on!
Comment #7
sushantpasteComment #8
sushantpasteFixed
Comment #9
murphy.m.j commentedSir, I have made sure that I have tried the 2 above approaches and do not have this working OK.
I have a civiCRM event, csp#2, with the following beginning / ending datetime: Jul 10, 2012 9:41 PM Jul 31, 2012 12:00 AM. when I run either #2 or #5, my events/calendar is blank.
under all/modules/civicrm_events i have the verious css&js dirs along with some php files.
Under sites/all/libraries/fullcalendar I have the fullcalendar.css, fullcalendar.js, fullcalendar.min.js, fullcalendar.print.css & gcal.js. I also have another dir named fullcalendar with all the previous files in this dir.
There is not much else installed in this instance of Drupal; please advise what I can do to fix this problem. thanks.
Comment #10
sushantpasteCan you please try with full calendar of version
Fullcalendar 1.4.2
Hth
Sushant
Comment #11
Jerimee commentedHaving this same problem with fullcalendar 1.4.2 setup per instructions.
Notice: Undefined property: CRM_Core_DAO::$start_date in events_calendar() (line 146 of /home/sfc/www/production/devtwo/sites/all/modules/civicrm_events/civicrm_events.module).
Notice: Undefined property: CRM_Core_DAO::$end_date in events_calendar() (line 147 of /home/sfc/www/production/devtwo/sites/all/modules/civicrm_events/civicrm_events.module).
Notice: Undefined property: CRM_Core_DAO::$start_date in events_calendar() (line 146 of /home/sfc/www/production/devtwo/sites/all/modules/civicrm_events/civicrm_events.module).
Comment #12
Jerimee commented#5 worked. Should the module itself be updated to reflect this?
Comment #13
murphy.m.j commentedJerimee; dont know where it says this at all, maybe osmossis or I am just not all knowing about drupal; the simple resolution that finally worked for me after many hours of 'fun', after you do a normal install - which it looks like you did- was
a) download the fullcalendar 1.5.2 version - someone recommended this version - dont know why but it works, so I dont ask.
b) unpack the fullcalendar files on your local PC.
c) in unpacking the files, there will be a css and js directory under a dir called fullcalendar.
d) on my web host, I went to www/sites/all/modules/civicrm_events - the js and css dirs and copyied the files from my local js to the hosting web sites/js dir. Ditto on the css dirs. also.
I was getting blank calendars and offering 1st born, to whatever to somehow make this work. I have no clue why these css and js files are not included with the distro.
Comment #14
tonyhrx commentedAmend the module around line 147
Replace ( $dao->start_date ) and ( $dao->end_date ) with ( $dao->start ) and ( $dao->end )
This removes the error messages.
Comment #15
RegB commentedThank you! The last fix did the trick for me.
Comment #16
sushantpaste