General developer forum

Calendar, Facetoface - Global Events do not display, Course Events do

 
Picture of Rob Galpin
Calendar, Facetoface - Global Events do not display, Course Events do
 

ISSUE:
Global events created in a Facetoface plugin are NOT displaying in the calendar, Course events ARE displaying. This worked before we upgraded to Moodle 3.3.

Using an old version of Facetoface plugin (2.2.3.1) to register users to sessions, plugin has been  customized to the point where upgrading it will require a lot of development and testing - trying to avoid that. Again, the calendar worked fine until we upgraded to Moodle 3.3. We have upgraded Moodle from a much older version of Moodle: 2.x.

Facetoface session has a CALENDAR OPTIONS field. 

When we set a session CALENDAR DISPLAY SETTINGS to: COURSE, the all the dates for that session appear on the calendar as designed.

If we set CALENDAR DISPLAY SETTINGS for the session to: SITE, which is the same as GLOBAL (green highlight box) the dates do not appear on the calendar.

Facetoface uses a data item referenced as $Facetoface->showoncalendar to identify a session calendar setting as either: SITE or COURSE or NONE.

Since the calendar handles the setting of COURSE correctly, I am looking for where the calendar is failing to handle the setting of SITE/GLOBAL (green highlight on display) for a session correctly.

Any ideas on why this is happening or where to look would be a great help! 

Thank you!


 
Average of ratings: -
Picture of Rob Galpin
Re: Calendar, Facetoface - Global Events do not display, Course Events do
 

How does the calendar use the event record to determine GLOBAL or COURSE calendar setting for the event / date / session?

 
Average of ratings: -
Picture of Rob Galpin
Re: Calendar, Facetoface - Global Events do not display, Course Events do
 

It looks like the event value that is set differently when SITE is selected is the $event->courseid. When this is set to the Facetoface id the date is displayed correctly with a pink hilite. 

When $event->courseid is set to SITEID (value of 1) as is the case when SITE is selected, the calendar does NOT react correctly by displaying with the green hilite. It used to in our earlier version of Moodle. 

Is the new calendar API looking for a different value now? Or is it looking at a different event property to determine the hilite?


 
Average of ratings: Useful (1)
Picture of Rob Galpin
Re: Calendar, Facetoface - Global Events do not display, Course Events do
 

Changing $newevent->modulename='facetoface';

TO:

$newevent->modulename = 0;

Gets the calendar to display these dates as GLOBAL/ SITE. I don't know why. But it also makes the calendar display 2 instances on mouseover.

Does anyone have knowledge of the calendar API that could lend some direction as to what is going on? 

Probably some holes in my understanding of the Calendar API - any direction would be appreciated.

 
Average of ratings: -
Picture of Graham Hall
Re: Calendar, Facetoface - Global Events do not display, Course Events do
 
Hi Rob,


did you manage to get this resolved / identify the issue?

much appreciated


graham

 
Average of ratings: -
Picture of Istvan Denes
Re: Calendar, Facetoface - Global Events do not display, Course Events do
 

Hi.

Indeed.

/calendar/classes/local/event/container.php. 

Here there is a function (p135) called get_fast_modinfo() which does not contain any facetoface instances at course = 1. 

Originally this function is located in /lib/modinfolib.php and it calls course_modinfo::instance() on the same page;

This is everything what I found so far, I started to be familiar with that class but it is extremely complex (or I am tired).

I is also worth to check cm_info class in the same file, it might be the key to understand what is the problem with the facetoface plugin. 

I hope it helps.

Istvan

 
Average of ratings: -
Picture of Michael Milette
Re: Calendar, Facetoface - Global Events do not display, Course Events do
Core developersParticularly helpful MoodlersPlugin developers

Has anyone made any progress on this? I applied the changes listed in this discussion as well as modified the deletion functions so that they could still find the entries to be removed when you update or delete a session.

However, I am also getting the double global entries. My understanding is that the code:

  • Creates a calendar user entry for the teacher.
  • Creates a calendar site entry for the session.

I am still trying to figure out what the third entry might be for. What I do know is that, while it lists the custom field labels, it doesn't actually put the information in it in one of the three entries.

I would really like to get this thing working. I tried Booking module plugin however this one just seems a little more intuitive and Booking doesn't seem to work any better with the Site calendar.

Any ideas?

Best regards,

Michael

 
Average of ratings: -