Problem upgrading hotpot from 1.8 to 2.09

Problem upgrading hotpot from 1.8 to 2.09

by Sandra King -
Number of replies: 8

Hello, I have upgraded our most active Moodle to 2.09 (my PHP can't be upgraded until all versions of Moodle on our server are in 2.0 +) Months ago I did a trial upgrade with an earlier version of 2.0+ and I thought I remembered upgrading HotPot at the same time with no problems.  Unfortunately this time around I get this error:

Fatal error: Class 'context_course' not found in /home/olt/htdocs/moodle2/moodle-20/mod/hotpot/db/upgrade.php on line 446

IF I block the offending code I get this error...
Fatal error: Class 'context_module' not found in /home/olt/htdocs/moodle2/moodle-20/mod/hotpot/db/upgrade.php on line 477

Could someone please help me figure out what I have done wrong?

Here is my server info...

moodle         2.0.9  
unicode     installed and enabled
database     mysql     version 5.0.4
php         version 5.2.17

all on a redhat linux server.

Average of ratings: -
In reply to Sandra King

Re: Problem upgrading hotpot from 1.8 to 2.09

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Dear Sandra,
thanks for reporting this. I can see the cause of the error, and I will fix it tomorrow, and let you know via this forum when you can download the new scripts.

regards
Gordon

In reply to Gordon Bateson

Re: Problem upgrading hotpot from 1.8 to 2.09

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Sandra,
I have removed the use of the PHP class "context_module" (and similar) which was causing the error in the HotPot upgrade script.

Please download the modified HotPot module for Moodle 2.x at your earliest convenience and try your upgrade again.

regards
Gordon

In reply to Gordon Bateson

Re: Problem upgrading hotpot from 1.8 to 2.09

by Sandra King -

Thank you for the quick fix - unfortunately I am still getting an error message...

mod_hotpot

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/olt/htdocs/moodle2/moodle-20/mod/hotpot/lib.php on line 1772


I look forward to hearing back from you.  Thank you for your help and maintenance of this program...

In reply to Sandra King

Re: Problem upgrading hotpot from 1.8 to 2.09

by Sandra King -

fixed that by changing a :: to a ->

 

line 1772          return $classname->instance($instanceid, $strictness);

In reply to Gordon Bateson

Re: Problem upgrading hotpot from 1.8 to 2.09

by Sandra King -

Now I am getting this error

Source file not found (or empty): course_modules.id=1219,

and a whole stack of similar errors.  I am going to try to track this down in the forum.  I think I read something about a similar problem in here somewhere...

In reply to Sandra King

Re: Problem upgrading hotpot from 1.8 to 2.09

by Sandra King -

When I get into a course with HotPot and click on a hotpot quiz I get

This legacy resource type (file) was not yet migrated, sorry.

 

I guess I am going to have to go looking for the files in the olt Moodledata and figure out how to upgrade them from the 1.8 version to the 2.0+ version.

In reply to Sandra King

Re: Problem upgrading hotpot from 1.8 to 2.09

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Sandra,
that message comes from the Resource module - not that HotPot module. Ify ou get that message, then it is because the Hot Potatoes exercise was added as a Resource and not a HotPot activity.

It indicates that none of the files from the previous site (1.8 ?) were migrated. Looks like you need to redo the migration. It can take a lo-o--ng time to migrate all the files, and once you have finished you must always keep the database and moodledata folder together. You can't split them up anymore like you used to be able to in Moodle 1.x.

BTW, I have fixed the syntax error that you reported in "mod/hotpot/lib.php". Thanks for reporting that.

Are you sure it is possible to migrate from Moodle 1.8 to Moodle 2.0. Do you not have to go via Moodle 1.9? If you have a choice, I would recommend going to Moodle 1.9 first, then backup the database file moodledata folder at that point. Then try the migration to Moodle 2.x

all the best
Gordon

In reply to Gordon Bateson

Re: Problem upgrading hotpot from 1.8 to 2.09

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Sandra,
I switched my server over to PHP 5.2.17 this afternoon so I could test how the HotPot module runs in that environment.

I found a couple of other places where PHP 5.2 produces a syntax error when it comes across "::". I have fixed those errors too now, and uploaded the revised scripts to the moodle.org -> Plugins repository.

Please download and install the latest version (2010080350) when you have a chance.

best regards
Gordon