Face to Face in moodle 3.1.2

Face to Face in moodle 3.1.2

by James Todd -
Number of replies: 33

We've just upgraded to version 3.1.2.

Now when adding a new course the date defaults to 1 jan 1970 and can't be changed.

The face to face plugin only goes to 2.8 is there a plan to update it.


Any help would make me smile.

Thanks Jimi

Average of ratings: -
In reply to James Todd

Re: Face to Face in moodle 3.1.2

by James Todd -

Just checked the database.

There's is no data in the timestart and timefinish fields in the mdl_facetoface_sessions_dates table.



In reply to James Todd

Re: Face to Face in moodle 3.1.2

by Ali Hastie -

Hi

We are also having the 1970 date problem too with Moodle 3.1.2 version.


In reply to Ali Hastie

Re: Face to Face in moodle 3.1.2

by James Todd -

We've rolled back to 2.9 due to the amount of unsupported plugins and issues.

In reply to James Todd

Re: Face to Face in moodle 3.1.2

by Randy Thornton -
Picture of Documentation writers

Looks like this plugin is in danger of becoming abandoned.

It has not been updated for over a year and half now and last version is marked working with M 2.8. It tosses up a ton of debug messages in 3.1 with full debug on.

The Moodle Tracker for it does not seem to exist either. The Github repo is no more up to date than the code here.


FacetoFace is a core and key feature of Totara, which is where I know it from. It is being renamed in the upcoming Totara 2.9 = 9.0 release ("FacetoFace" -> "Seminar") but given the fork of Totara code from Moodle, I have no idea if that updated version could or would be released here or not.


In reply to James Todd

Re: Face to Face in moodle 3.1.2

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators

Hi Jimi

I'm trying to reproduce the failure. Can you explain. For me it works with Moodle 3.1.2

Ralf

In reply to Ralf Hilgenstock

Re: Face to Face in moodle 3.1.2

by Tim Pattison -

We are also experiencing this issue after haveing upgraded to 3.1.2

This seems to affect newly created sessions (or when editing existing sessions). My understanding of the problem is that the timestart and timefinish fields are not being populated in the database hence it returns the default 1970 date.

In reply to James Todd

Re: Face to Face in moodle 3.1.2

by Vanessa Alzate -

Does anyone have an alternative to this plug-in?  It has all the features I need and really would prefer not to reinvent the wheel.


Would it be best to roll back to an earlier version?

In reply to Vanessa Alzate

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

When debugging is on it shows:

Notice: Undefined index: timestart[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 235

Notice: Undefined index: timefinish[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 236

The lines in session_form.ph

 $starttime = $data["timestart[$i]"];

$endtime = $data["timefinish[$i]"];

As the 1st Jan 1970 is the sort of beginning of dates for Unix it seems as though the $starttime is not being pushed into "timestart" hence the problem.

Does anyone know if there is a new name for 'starttime' in the moodle core code?  Anyone solved this one - this is a key part of our moodle setup and is holding us back from upgrading.

In reply to Mick Mullane

Re: Face to Face in moodle 3.1.2

by Josh Willcock -
Picture of Core developers Picture of Plugin developers

You have hit the nail on the head Mick, I apologise I did not post this earlier - I fixed this a long time ago and did not think about other organisations as I have been very busy!

The file is /mod/facetoface/sessions.php

You can change 174 to use $fromform->timestart[$i] and fromform->timefinish[$i] (from $timestartfieldand $timefinishfield) and then change

Then Lines 176 + 177 to read:

$date->timestart = $fromform->timestart[$i]

$date->timefinish = $fromform->timefinish[$i]


I have attached a github change screenshot for those of you who want to see it

Attachment Screen Shot 2016-12-05 at 16.21.38-min.png
Average of ratings: Useful (3)
In reply to Josh Willcock

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

Tremendous Josh - I'll have a look at that this morning and report back.

In reply to Josh Willcock

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

Hi Josh,

made those changes, makes sense,  but I got this:

Notice: Undefined index: timestart[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 235


Notice: Undefined index: timefinish[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 236


Notice: Undefined variable: timestart in /var/www/html/moodle/mod/facetoface/sessions.php on line 174


So I changed the code in sessions.php (around line 170) to:

//$timestartfield = "timestart[$i]";

       $timestart = "timestart[$i]";

       //$timefinishfield = "timefinish[$i]";

       $timefinish = "timefinish[$i]";

       if (!empty($fromform->$timestart[$i]) and !empty($fromform->$timefinish$

           $date = new stdClass();

           $date->timestart = $fromform->$timestart[$i];

           $date->timefinish = $fromform->$timefinish[$i];

           $sessiondates[] = $date;

       }

   }


Which got rid of 

Notice: Undefined variable: timestart in /var/www/html/moodle/mod/facetoface/sessions.php on line 174

BUT I guess I may have illegally declared 'timestart' and 'timefinish' as variables

I'm now looking through /classes/session_form.php to see if I need to declare the index 'timestart' and 'timefinish' but I guess that they may be declared somewhere else - sessions.php?


Any insight would be of immense help!



In reply to Mick Mullane

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

Hi Josh, 

I've tried this in sessions.php at line 310 onwards - but that hasn't solved the issue either - may be barking up the wrong tree...

Line 310


if ($session->sessiondates) {

       $i = 0;

       foreach ($session->sessiondates as $date) {

           $idfield = "sessiondateid[$i]";

           //$timestartfield = "timestart[$i]";

           $timestart = "timestart[$i]";            

           //$timefinishfield = "timefinish[$i]";

           $timefinish = "timefinish[$i]";            

           $toform->$idfield = $date->id;

           //$toform->$timestartfield = $date->timestart;

           $toform->$timestart = $date->timestart;            

           //$toform->$timefinishfield = $date->timefinish;

           $toform->$timefinish = $date->timefinish;            

       $i++;

       }
In reply to Josh Willcock

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

Hi Josh, 

still can't get this fix to work.  I have tried a few things such as chasing down 'timestartfield' in the session_form.php but to no avail yet.

I've reinstalled the plugin and made your changes but am still faced with:

Notice: Undefined index: timestart[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 235

Notice: Undefined index: timefinish[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 236

Notice: Undefined variable: timestart in /var/www/html/moodle/mod/facetoface/sessions.php on line 174


any input you could give would be very welcome.


cheers


Mick


In reply to Mick Mullane

Re: Face to Face in moodle 3.1.2

by Jeremy Schweitzer -
Picture of Plugin developers Picture of Testers

This repository has a slightly updated version that also include preliminary support for Global Search:

https://github.com/CWRTP/facetoface-2.0

It seems to include a working version of this fix. 



In reply to Jeremy Schweitzer

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

Yes applied that to the sessions.php file - that still gives me the 'undefined index' error:

Notice: Undefined index: timestart[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 235

Notice: Undefined index: timefinish[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 236

on Github the /classes/session_form.php file is here

https://github.com/CWRTP/facetoface-2.0/blob/master/classes/session_form.php

the lines are here:

235    $starttime = $data["timestart[$i]"];

236    $endtime = $data["timefinish[$i]"];


just wondering what is required to declare timestart and timefinish as indices on the form.  Don't know enough about handling data from the input form into the array used by session.php!  Has the fix worked for anyone else?

In reply to Josh Willcock

Re: Face to Face in moodle 3.1.2

by Michele Balazs -

Thanks Josh. Worked for me!

In reply to Michele Balazs

Re: Face to Face in moodle 3.1.2

by Mick Mullane -

Glad that worked for you Michelle - what system are you running on?  Windows or Linux?  I still can't get this fix to work for me...  Any info would be appreciated!

In reply to Josh Willcock

Re: Face to Face in moodle 1970 FIX

by Richard Wallace -

Josh


Thanks for that worked perfectly when I coded it correctly, here are my changes to

facetoface/sessions.php

lines 172 to 178

..........................................................

        $timestartfield = "timestart[$i]";
        $timefinishfield = "timefinish[$i]";
        if (!empty($fromform->timestart[$i]) and !empty($fromform->timefinish[$i])) {
            $date = new stdClass();
            $date->timestart = $fromform->timestart[$i];
            $date->timefinish = $fromform->timefinish[$i];
            $sessiondates[] = $date;

..............................................................

there also is a newer version of the plugin at GitHub whic has the time stamp 2016, which I have attached below as well.

Cheers

Richard

In reply to Richard Wallace

Re: Face to Face in moodle 1970 FIX

by Richard Wallace -

Still having error when turning on debugging,

Notice: Undefined index: timestart[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 235

Notice: Undefined index: timefinish[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 236

being

   $starttime = $data["timestart[$i]"];
    $endtime = $data["timefinish[$i]"];

Any fixes?



In reply to Richard Wallace

Re: Face to Face in moodle 1970 FIX

by Mick Mullane -
Hi Richard, 


yes exactly the same issue that we are having.  I've even tried updating time start and time finish names in that file too - but I'm worried about chasing my tail and renaming variables!

If anyone has got around this it would be appreciated if you could feed in.  Face to Face is one of the most used features on our site (70,000 users) and the lack of development is preventing us from upgrading to a later version of moodle.



In reply to Mick Mullane

Re: Face to Face in moodle 1970 FIX

by Michele Balazs -

Hiya


I had this after a recent upgrade. I made the changes outlined above and all was well!


I attach our sessions.php so you can see the 2 changes made.

Mich

In reply to Michele Balazs

Re: Face to Face in moodle 1970 FIX

by Mick Mullane -

Many Thanks Michele, 

I'll compere to my file.

Just a quick question - what do you get if you switch debugging on?  Do you get the other messages that have been reported or does the plugin just work?


In reply to Michele Balazs

Re: Face to Face in moodle 1970 FIX - WORKS

by Richard Wallace -

Mich

Well done, your version of the session.php works perfectly for me and seems to get rid of all the errors occurred above, thanks for your efforts.

Richard

In reply to Michele Balazs

Re: Face to Face in moodle 1970 FIX

by Mick Mullane -

Thanks Mich, 

that works for me too.  Looking at the code you have print_r($fromform) in a line 174 which I didn't have from the latest GitHub release.  I may go and have a look at the GitHub files to do a line by line check...

Still getting the bug report though:

Notice: Undefined index: timestart[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 235

Notice: Undefined index: timefinish[0] in /var/www/html/moodle/mod/facetoface/classes/session_form.php on line 236
stdClass Object ( [id] => 0 [f] => 260 [s] => 0 [c] => 0 [custom_location] => b [custom_venue] => b [custom_room] => b [datetimeknown] => 1 [date_repeats] => 1 [sessiondateid] => Array ( [0] => 0 ) [timestart] => Array ( [0] => 1486649100 ) [timefinish] => Array ( [0] => 1486735500 ) [capacity] => 11 [duration] => 0 [details_editor] => Array ( [text] => [format] => 1 [itemid] => 659511185 ) [submitbutton] => Save changes [allowoverbook] => 0 [normalcost] => 0 [discountcost] => 0 )


Can't be 100% certain that that bug wasn't there before the upgrade.


Thanks for your work.  


Mick

In reply to Mick Mullane

Re: Face to Face in moodle 1970 FIX

by Aylwin Cal -

Hi Mick,

I've encountered the same 1970 problem.  I've downloaded the latest github version and replaced sessions.php with the one provided by Mich above.  It hasn't fixed the problem though.  Was there anything else you had to change to get it working correctly?

By the way, the debug output is slightly different (underlined):

Notice: Undefined index: timestart in /var/www/html/mod/facetoface/classes/session_form.php on line 234

Notice: Undefined index: timefinish in /var/www/html/mod/facetoface/classes/session_form.php on line 235
stdClass Object ( [id] => 1875 [f] => 0 [s] => 1875 [c] => 0 [datetimeknown] => 1 [date_repeats] => 1 [sessiondateid] => Array ( [0] => 3826 ) [timestart[0]] => 1488391500 [timefinish[0]] => 1488391500 [capacity] => 10 [duration] => 0 [details_editor] => Array ( [text] => [format] => 1 [itemid] => 399933577 ) [submitbutton] => Save changes [allowoverbook] => 0 [normalcost] => 0 [discountcost] => 0 )

Aylwin

In reply to Aylwin Cal

Re: Face to Face in moodle 1970 FIX

by Mick Mullane -

Hi Aylwin, 

the trick now is to switch off debugging and just let it work.  I couldn't get past where you are now and couldn't figure out how others said the bug was fixed.  All I did was switch off debugging and it carries on ok - I'm not sure what this could mean going forward - but its a fix...

Sorry I couldn't offer more help!

BTW I did try altering the session_form.php but made no difference.

best 

Mick

In reply to Mick Mullane

Re: Face to Face in moodle 1970 FIX

by Richard Wallace -

Yes that is what we did, so there still is an error in the back ground, but it still works... just.

Time to find an alternative unfortunately as FaceToFace has been excellent.

Cheers Richard

In reply to Mick Mullane

Re: Face to Face in moodle 1970 FIX

by Aylwin Cal -

Hi Mick,

Thanks for the reply.  In my case, the fix didn't work regardless of whether debug was enabled or not.  Then I noticed that I was running 3.1.1+ and the original title of this thread mentioned 3.1.2.  So I upgraded to the latest stable 3.2.1+ and now face-to-face is fine and the debug errors are gone too.

Well, there's a new debug message but I guess it's related to the "Update this Face-to-Face" button (not a big deal):

update_module_button() has been deprecated and should not be used anymore. Activity modules should not add the edit module button, the link is already available in the Administration block. Themes can choose to display the link in the buttons row consistently for all module types.

  • line 1129 of /lib/deprecatedlib.php: call to debugging()
  • line 96 of /mod/facetoface/view.php: call to update_module_button()

In reply to Michele Balazs

Re: Face to Face in moodle 1970 FIX

by Miz M -

Thank you Michele, for this fix. I'm using 3.0. I was able to use this code fix and updated sessions.php and this worked great. I had to purge all cache first though and removed all old sessions. smile

In reply to Richard Wallace

Re: Face to Face in moodle 1970 FIX

by Chris Maki -

Your fix worked great, using face to face in Moodle 3.3.

In reply to James Todd

Re: Face to Face in moodle 3.1.2

by George Mihailov -

We at Lambda Solutions did fix the plugin. You can get it from our fork https://github.com/lambda-solutions/facetoface-2.0

Now it is on master branch, will tag it soon.

Average of ratings: Useful (1)
In reply to George Mihailov

Re: Face to Face in moodle 3.1.2

by Randy Thornton -
Picture of Documentation writers

George,

Thanks to Lambda for updating this and making this available to the community.

Randy

In reply to James Todd

Re: Face to Face in moodle 3.1.2

by Jason Hollowell -
Picture of Particularly helpful Moodlers

I should probably start a new message thread for this but...

I am running a heavily hacked version of Face to Face and am having a problem with the module not retrieving the 'details' from a session when it is edited.

I mean, when a user (teacher or admin) clicks on the edit button to edit a session, the details for that session are not retrieved and the html editor is thus blank. If the user changes the time, for example, and then saves the edit, the details are effectively erased.

We have had this problem for a long time and have put up with it but now that I've managed to update everything for 3.2 (including the date issue discussed here) I was hoping to fix this issue but am stuck. I've poked around in sessions.php and view.php for so long now that I'm starting to get bug eyed. black eye

I wonder if anyone might have any ideas about where I should look?

For reference, we are using a version of the Face to face module that:

1. Allows for multiple reservations within one instance of face to face (multiplession version)

2. Allows for a maximum number of reservations per one month period (adjustable via in module setting)

3. Allows for reservation lock if students miss more than a set number of sessions (without canceling)

4. Removes the ability to cancel from one hour prior to the start of the session with a direct contact (via phone) message displayed.

5. Prevents users from making more that a set number of reservations per day (adjustable via in module setting)

6. Has customized attendance settings to enable #3 above to function

Due to all these customizations, I basically have to keep this version but would love to get this little bug fixed. smile

Regards

Jason