Version,php file of certificate

Version,php file of certificate

by Sarah Fauset -
Number of replies: 9

I accidently changed the version file to a number like this 5555555555555555

because I remember having a problems while trying to update....a while back.

However, I would like to reset it to the number it was at...which is much lower than this number but it said you can't downgrade this number.

I am wondering how I fix this problem because I would like to update the plugin since there is a new version out.


Average of ratings: -
In reply to Sarah Fauset

Re: Version,php file of certificate

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This is possible, but quite tricky to do.

You might think you would just need to change the row in mdl_config_plugins where plugin = 'mod_certificate' and name = 'version'. However, that does not work due to caching.

I think the way to do this that works is to make a script called temp.php that does

require_once('config.php');
set_config('version', 1234567890, 'mod_certificate');

You will need to find out what the right version number to use there is.

In reply to Tim Hunt

Re: Version,php file of certificate

by Sarah Fauset -

Okay where does this file need to go exactly?

What do I write for the beginning part and ending part?

In reply to Sarah Fauset

Re: Version,php file of certificate

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Sorry, I missed out the necessary opening part:

<?php
require_once('config.php');
set_config('version', 1234567890, 'mod_certificate');

That would need to go in a file temp.php in the top level folder next to config.php.

Then, go to .../url/of/your/moodle/temp.php, and it should reset the installed version number.

Then delete that file.

In reply to Tim Hunt

Re: Version,php file of certificate

by Sarah Fauset -

I don't even see a config,php file.

Hmmm!!!

In reply to Sarah Fauset

Re: Version,php file of certificate

by Sarah Fauset -

Oh you mean top level of moodle...not the certificate.

In reply to Sarah Fauset

Re: Version,php file of certificate

by Sarah Fauset -
Okay I have done that and nothing has happened. The version number hasn't changed and when I go to the link, I don't see anything.


Do I need something on the ending of that code?

In reply to Sarah Fauset

Re: Version,php file of certificate

by Sarah Fauset -
You're an absolute genuis!!!!!!!!!!! It worked!!!!!!!!!


Okay now I have another question for you....I am using 2.7 moodle. I want to update to the latest moodle.

I have had some custom work done on the certificate. Can I just copy the contains of the certificate over to the latest certificate and will it work okay and update?

In reply to Sarah Fauset

Re: Version,php file of certificate

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The best way to manage customisations is to use a version control tool like git to manage the source code.

This is not the place to dicuss the details of that. I suggest you post again in the General Developer Forum

In reply to Tim Hunt

Re: Version,php file of certificate

by Sarah Fauset -

Now I am trying to upgrade moodle from 2.7 to 3.0.

I just realized I have changed another version file but this time for block_activities_modules

How do I fix this? Same way?

Here is the error:

Cannot downgrade block_activity_modules from 2014111000000 to 22014111000.

Debug info: 
Error code: cannotdowngrade
Stack trace:
  • line 942 of /lib/upgradelib.php: downgrade_exception thrown
  • line 429 of /lib/upgradelib.php: call to upgrade_plugins_blocks()
  • line 1647 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 677 of /admin/index.php: call to upgrade_noncore()