Face-to-Face 1.4.0 - unexpected T_OBJECT_OPERATOR in lib.php on line 919

Face-to-Face 1.4.0 - unexpected T_OBJECT_OPERATOR in lib.php on line 919

by Steve Messinger -
Number of replies: 3

Darn -

Shortly after the announcement of v1.4.0, on Dec 5, I downloaded it and
tried to install it.

Unfortunately, it didn't work. After deleting the old mod/face-to-face
directory and copying in the new one, I got nothing but a blank page
when attempting to go to the .../moodle/admin/index.php page.
I also got the blank page when attempting to go to the
moodle/admin/settings.php?section=modsettingfacetoface

I was able to re-install the version from Nov 30 and everything worked ok.

I also tried download a newer version (as of Dec 7), but got the same
failure.

I found that going to /moodle/admin/settings.php?section=debugging
attempting to turn on debugging output also did not work.

So, I re-installed the older version, turned on the debugging, and then
tried installing 1.4.0 again.

Then I found that I'm getting this error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/capitals/public_html/moodle/mod/facetoface/lib.php on line 919

This appears to be the line in question:

$grading_info = grade_get_grades(reset($records)->course, 'mod', 'facetoface',
reset($records)->facetofaceid, $userids);

--
Steve Messinger




Average of ratings: -
In reply to Steve Messinger

Re: Face-to-Face 1.4.0 - unexpected T_OBJECT_OPERATOR in lib.php on line 919

by François Marier -
Hi Steve,

Which version of PHP are you using?

Also, if you have shell access to your box, can you try running:

php -l lib.php

Finally, if you change line 910 in lib.php from:

if (!$records) {

to:

if (!$records or 0 == count($records)) {

does it make a difference?

Cheers,
Francois
In reply to François Marier

Re: Face-to-Face 1.4.0 - unexpected T_OBJECT_OPERATOR in lib.php on line 919

by Steve Messinger -
It is PHP 4.4.4, PHP API 20020918, PHP Extension 20020429, Zend Extension 20050606, with Zend optimization enabled.

I don't currently have shell access to the system.

I tried your change and got the same error.

Thanks.

--
Steve
In reply to Steve Messinger

Re: Face-to-Face 1.4.0 - unexpected T_OBJECT_OPERATOR in lib.php on line 919

by François Marier -
Ah, PHP 4, that's must be the problem.

If you can switch to PHP 5 inside your hosting environment, I would highly recommend it. Now that PHP4 is officially obsolete and unsupported, we no longer test the Face-to-face with it.

So while we're not going to break PHP4 support on purpose, you're very likely to run into other broken bits (such as the managersemail bug you reported last week).

According to http://www.site5.com/hosting, it looks like both versions of PHP are available in your environment. See this thread to switch to PHP5:

http://forums.site5.com/showthread.php?t=7816

Cheers,
Francois