list of languages can not be used

list of languages can not be used

by Robert Edwards -
Number of replies: 12

Hi,

On Moodle 2.6. Error:  get_list_of_languages() can not be used any more, please use get_string_manager()->get_list_of_translations() instead.

 Does anyone have a simple resolution for editing code? 

Thanks,

lost in code Robert

Average of ratings: -
In reply to Robert Edwards

Re: list of languages can not be used

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Robert, Moodle 2.6 isn't supported anymore, I'd highly reccomend you upgrade to a supported version. It will be much easier for the community to give you useful advice as it's unlikely we'll have a 2.6 installation around to refer to.

As for the error itself, I'm not familiar with it but it sounds self-explanatory. Find get_list_of_languages() in your code and replace it with get_string_manager()->get_list_of_translations(). If you post more detail about your code and what you're trying to do, someone might be able to offer more help.

In reply to Mark Johnson

Re: list of languages can not be used

by Robert Edwards -
Thanks, Mark, I appreciate your reply and confidence should be an easy fix. My fault I had not upgraded from version 2.6 as having checked on the up-grade some years back. I've been working on our other websites for last hours and while on a roll I'll look for the coding again in Moodle. Mark, by chance would you know the next highest version to upgrade to as aware must be completed in steps?
In reply to Robert Edwards

Re: list of languages can not be used

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

According to the upgrade instructions, you will need to go 2.6 to 2.7, then 2.7 to 3.2, then 3.2 to 3.7: https://docs.moodle.org/37/en/Upgrading#Check_the_requirements https://docs.moodle.org/32/en/Upgrading#Check_the_requirements

In reply to Mark Johnson

Re: list of languages can not be used

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Mark

Are you aware that the MoodleDocs wikis of no more supported releases are not maintained?

For example the link you posted https://docs.moodle.org/32/en/Upgrading#Check_the_requirements is linked further to https://docs.moodle.org/32/en/Environment, which still has a screen-shot from Rel. 2.7. See the discussion https://moodle.org/mod/forum/discuss.php?d=391996.
In reply to Robert Edwards

Re: list of languages can not be used

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Are you sure, you want to edit the code? Why, to circumvent this error? Or, have you already edited the code? If not, what made the site unusable? Something must have changed. A system upgrade? Perhaps PHP? If the site is broken it is too late, otherwise there is this https://docs.moodle.org/26/en/Environment test built in to Moodle.

About the march route. Since I am a fan of Moodle LTS releases, I usually take the following path:
- https://docs.moodle.org/26/en/Upgrading (to 2.6.final)
- https://docs.moodle.org/27/en/Upgrading LTS
- https://docs.moodle.org/31/en/Upgrading LTS
- https://docs.moodle.org/35/en/Upgrading LTS

The advantage/advise is to take a pause at each step and test thoroughly before moving on. WATCH out for the climb in the PHP requirements. Not to mention the full https://docs.moodle.org/en/Site_backup before each step.

BTW, pure upgrading is discussed in the Installing and upgrading help forum https://moodle.org/mod/forum/view.php?id=28.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: list of languages can not be used

by Robert Edwards -
Hi, Visvanath,

Thanks for the useful information. We had recently increased PHP to 7.3 as we also have WordPress sites in need of the increase. Do you believe that may have caused the instability?
In reply to Robert Edwards

Re: list of languages can not be used

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

You mean, your upgraded the PHP to 7.3 for your Moodle 2.6 site? That'd be asking too much! Moodle 2.6 was released in November 2013 - nobody has even talked about PHP 7 those days.

I have started compiling a PHP and DBMS compatibility of major Moodle releases just for such cases. Please note that this is work in progress. Corrections and additions are welcome!
In reply to Visvanath Ratnaweera

Re: list of languages can not be used

by Robert Edwards -

 Visvanath,

I was afraid that was the problem, the mystery is solved, thank-you. Now I must take it off the domain and do a fresh install of Moodle Release 3.7. as turned PHP back down to 5.6 trying to repair for up-grade w/o success. We used Moodle since 2008 teaching golf cart safety. I wish to thank the Moodle developers and contributors for assisting in saving lives and serious injuries to so many around the world. I had to investigate far too many preventable fatalities and serious injuries involving the very young and old. The sadness and guilt in families who lost children had been unbearable to some. I will get the new site functioning as soon as possible.

Best regards,

Robert

In reply to Robert Edwards

Re: list of languages can not be used

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
That is bad news. But, there may be good news too. If the PHP upgrade just broke the site (output) but didn't take you (interactively) through some upgrade route, the data must be intact - assuming your "repair for up-grade" didn't damage them. If you haven't done it already, pull a https://docs.moodle.org/26/en/Site_backup out of the server. The hardcore group here maintain a series of virtual machines in different stages of the LAMP stack to march old Moodle sites forward. The interface is always the site backup.
In reply to Visvanath Ratnaweera

Re: list of languages can not be used

by Robert Edwards -
You have no idea how much I appreciate that. You know I have a full copy backed up on another server. I first tried pointing DNS it to, but the same issues. I may try to point the domain again to my backup server, see if I may do the up-grades there, and migrate back the upgraded copy. I wonder if the site was hacked? This is my second move this year. I had first moved to a host in Europe due to refresh rate issues where the host said we can fix the issue, $80.00 a month VPN. I moved until back in July when I woke up to this message: this hosting account is suspended due to: CRYPTOMINING_HACKED. I lost several websites as over 35,000 servers were attacked in Europe by technology only known to be in the hands of Governments. Speculations were that technology was now in the hands of individuals. My back-up copies saved the sites. I'll keep working. After the hosting company I'm with now tried to help, the site is really torn up...
In reply to Robert Edwards

Re: list of languages can not be used

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
That hacking story is scary. I don't want to follow that hint, or more accurately, can not contribute anything. (Government owned hacking tools!) What bothers me are the things you are doing. Trying here, trying there.

If you still have a healthy site backup, immediately download it to your personal computer! If nothing worked and the backup is not prohibitively big (beyond 10 GB), you can write me a personal message if you want me to try in my battery of virtual machines I maintain for this purpose.
In reply to Visvanath Ratnaweera

Re: list of languages can not be used

by Robert Edwards -
Installed Moodle version 3.7.2 on the domain. Using the information stored in a secure server from the old Moodle site to rebuild. Happy as a "monkey with a new banana." Thanks for the lesson and help! In case you don't want to follow, hint:
Search phrases
What A 5-Day Crypto-Mining Hack Can Teach You About Your Security
Hackers Hit Dozens of Countries Exploiting Stolen N.S.A. Tool
Identity Theft Resource Center Report Date: 10/10/2019 September 2019 Category Summary

Kind regards,
Robert