Face-to-face (plugin)

Is it possible to repair face-to-face upgrade error?

 
 
Picture of Steve Messinger
Is it possible to repair face-to-face upgrade error?
 

Greetings!

I have been happily using a 1.9 version of moodle with face-to-face for about 4 years, and decided to attempt an upgrade to v2.3.   As per the upgrade documentation, that required going to v2.2 first. 

Unfortunately, the upgrade failed for the Face-to-Face module, with this error: 

mod_facetoface

Field "shortname" already exists

Stack trace:
    * line 573 of /lib/ddl/database_manager.php: ddl_exception thrown
    * line 141 of /mod/facetoface/db/upgrade.php: call to database_manager->add_field()
    * line 540 of /lib/upgradelib.php: call to xmldb_facetoface_upgrade()
    * line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
    * line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
    * line 269 of /admin/index.php: call to upgrade_noncore()

 

I removed the module and continued with the upgrade, which succeeded, and then attempted to add the face-to-face module again, but continue to get the same error.

Is there a way to recover from this? 

The "Server Checks" page says that everything is ok.  I'm running PHP ver 5.3.8 and mysql ver 5.1.65.14.0.    I installed moodle ver 2.2.6 (planning to then upgrade to ver 2.3).

 

Thanks for any assistance.

--

Steve Messinger

 

 

 

 

 

 
Average of ratings: -
Picture of Alastair Munro
Re: Is it possible to repair face-to-face upgrade error?
 

Hi Steve,

You should be able to fix this problem by changing the following line in mod/facetoface/db/upgrade.php about line 141:

$result = $result && $dbman->add_field($table, $field1);

needs to be changed to

if (!$dbman->field_exists($table, $field)) {
    $dbman->add_field($table, $field1);
}

Hopefully after that has been changed the upgrade will work without breaking.

Cheers,
Alastair

 
Average of ratings: -
Picture of Pierre Clavet
Re: Is it possible to repair face-to-face upgrade error?
 

Hi Alastair,

1st thank you for your time.  I'm also getting the same error when trying to upgrade to facetoface 2.2+. I tried the code change you're recommending above but got a different error message.  Here it is..

 

mod_facetoface

Notice: Undefined variable: field in /home/cooptraining/dev/mod/facetoface/db/upgrade.php on line 141 Fatal error: Call to a member function getName() on a non-object in /home/cooptraining/dev/lib/ddl/database_manager.php on line 153

Version I'm using: Moodle 2.2.6 (Build: 20121112)
MySQL: 5.0.92-log
PHP: 5.3.18

Thanks,

Pierre

 
Average of ratings: -
Picture of Alastair Munro
Re: Is it possible to repair face-to-face upgrade error?
 

Hi Pierre,

Sorry it took so long to reply. I noticed a problem with the post I put up with the fix. On the first line where is says "$field" it should be "$field1".

Hopefully once that is done it should work ok.

Cheers,
Alastair

 
Average of ratings: -