Error in module while upgrading to Moodle 3.0.1

Re: Error in module while upgrading to Moodle 3.0.1

by Perry Way -
Number of replies: 6

I have more information after trying to upgrade the Progress Bar block, I got this error related to my module "aclaurus". 

Plugin "mod_aclaurus" is defective or outdated, can not continue, sorry.

The Debug Info section mentions "Unsupported $module syntax detected in version.php. Error code: detectedbrokenplugin"

I have attached a screen shot. I suppose I should start examining the code but this is a part of Moodle I'm unfamiliar with and was hoping that someone would be able to speed me to where I need to study up on what changes occurred between version 2.9.x and 3.x with respect to module requirements.

Thanks!

Attachment screenshot.jpg
In reply to Perry Way

Re: Error in module while upgrading to Moodle 3.0.1

by Albert Ramsbottom -

I know you already know this but its very important to make sure your plugins/mods are compatible or are available for your upgraded version

Sorry smile


Albert

In reply to Albert Ramsbottom

Re: Error in module while upgrading to Moodle 3.0.1

by Perry Way -

Hi Albert, 

These are not modules I downloaded from the Moodle website. I have written about 10 modules. Some of them reports and some of them activity modules. I have had no problems with any other module and they have basically the same kind of version.php file. All of the rest of my modules have migrated to Moodle 3.x with zero problems. It is only this one with the problem. sad

In reply to Perry Way

Re: Error in module while upgrading to Moodle 3.0.1

by Perry Way -

I found it! WOW that was quite a strange thing. I totally overlooked that $module should now be $plugin. WOW! That's all that was wrong. Amazing! I solved it! It's working now! Interestingly enough I found my problem by Googling the error message and found a conversation on Github site at this URL where one of the comments illustrated the change from $module to $plugin: https://github.com/dasistwas/moodle-mod_booking/issues/22

Before:

<?php
// http://docs.moodle.org/dev/version.php
defined('MOODLE_INTERNAL') || die();
$module->component = 'mod_aclaurus'; // Full name of the plugin (used for diagnostics).
$module->version  = 2016041800;    // The current module version (Date: YYYYMMDDXX).
$module->requires = 2015102800;    // Requires this Moodle version.
$module->cron = 0;
$module->maturity = MATURITY_STABLE;
$module->release = '1.0 (build 2016-04-18)';
$module->dependencies = array();


After:

<?php
// http://docs.moodle.org/dev/version.php
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_aclaurus'; // Full name of the plugin (used for diagnostics).
$plugin->version  = 2016041800;    // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2015102800;    // Requires this Moodle version.
$plugin->cron = 0;
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '1.0 (build 2016-04-18)';
$plugin->dependencies = array();
Average of ratings: Useful (2)
In reply to Perry Way

Re: Error in module while upgrading to Moodle 3.0.1

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Good deal - I figured a look at the version files would get it for you!

In reply to Perry Way

Re: Error in module while upgrading to Moodle 3.0.1

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Moodle 3 does require some extra stuff in the version.php file.  I have been able to fix other plugins by comparing the version.php of a working plugin with the version.php of the broken plugin.  The biggest one is that it has to declare what kind of plugin it is so that 3.0 can read that and make sure it is in the correct folder - (you will notice that we no longer have to select the plugin type from the dropdown).  Sometimes that it is all it takes to install an "outdated" plugin.  If it was working in 2.9, I would hope that you could get it working in 3.0.  Of course, all of the normal warnings about trying to get an outdated plugin working in a new moodle!!  Backup, etc...

In reply to Emma Richardson

Re: Error in module while upgrading to Moodle 3.0.1

by Perry Way -

Emma, I haven't spotted anything new appearing in any of the version.php files for any other modules. There were a number of modules that needed to be upgraded and I have compared versions (I am using a version control system) and there are no changes I can spot. Additionally I haven't seen any place in version.php that is supposed to declare what kind of plugin it is like you mentioned.

The folder I have my plugin in is the "mod" folder which is the folder for all activity based modules. Which this module is, is an activity. I've looked at other kinds of modules as well, like report modules and block modules and local modules and none of them indicate anything that denotes what kind of plugin they are that I can find. Do you have any more information on that?

Here is my version.php file contents. I believe I have the module type correctly formed:

<?php
// http://docs.moodle.org/dev/version.php
defined('MOODLE_INTERNAL') || die();
$module->component = 'mod_aclaurus'; // Full name of the plugin (used for diagnostics).
$module->version  = 2016041800;    // The current module version (Date: YYYYMMDDXX).
$module->requires = 2015102800;    // Requires this Moodle version.
$module->cron = 0;
$module->maturity = MATURITY_STABLE;
$module->release = '1.0 (build 2016-04-18)';
$module->dependencies = array();