Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textlib_get_instance() can not be used any more, please use core_text::functioname() instead. #9

Open
jtuttas opened this issue Jul 27, 2015 · 3 comments

Comments

@jtuttas
Copy link

jtuttas commented Jul 27, 2015

Hello just use your script on Moodle 2.9.1 and get above error. Any Idea how to solve the problem? In Moodle 2.7 everythink workes fine !

Here ist the complete error message:

Default exception handler: Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: textlib_get_instance() can not be used any more, please use core_text::functioname() instead. Debug:
Error code: codingerror

  • line 1490 of /lib/deprecatedlib.php: coding_exception thrown
  • line 353 of /local/ldap/locallib.php: call to textlib_get_instance()
  • line 552 of /local/ldap/locallib.php: call to auth_plugin_cohort->ldap_get_group_members_ad()
  • line 120 of /local/ldap/cli/sync_cohorts.php: call to auth_plugin_cohort->ldap_get_group_members()

!!! Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: textlib_get_instance() can not be used any more, please use core_text::functioname() instead. !!!

@BrunoMalaval
Copy link

Hi,

I have same problem, and solve it by modifying source code as below.
but I need to make more tests to be sure all works fine

In file $MOODLEROOT/local/ldap/locallib.php :

Comment or delete lines (it appears in 2 functions)
$textlib = textlib_get_instance(); { => deprecated }

Replace line
$group = $textlib->convert($group, 'utf-8', $this->config->ldapencoding);
by
$group = core_text::convert($group, 'utf-8', $this->config->ldapencoding);

and every occurrence of "textlib::" by "core_text::"

For information, not sure this development will be update
Unfortunately, Patrick Pollet died in january 2015, he was a great french contributor to Moodle

@prithvirajmohanty
Copy link

Thanks BrunoMalaval for your suggestion.
I am using moodle 2.9.2.I installed the moss.I am getting the following error while moving to moss antiplagiarism.

get_context_instance() is deprecated, please use context_xxxx::instance() instead.
line 3332 of \lib\deprecatedlib.php: call to debugging()
line 109 of \plagiarism\moss\settings.php: call to get_context_instance()
Did you remember to call setType() for 'mossuserid'? Defaulting to PARAM_RAW cleaning.
line 1316 of \lib\formslib.php: call to debugging()
line 288 of \lib\formslib.php: call to moodleform->detectMissingSetType()
line 206 of \lib\formslib.php: call to moodleform->_process_submission()
line 112 of \plagiarism\moss\settings.php: call to moodleform->moodleform()

@BrunoMalaval
Copy link

Hello,

get_context_instance() is a Moodle function, and is deprecated now with new versions of Moodle.

I take a look at the Moss plugin, it hasn't be update for several years.
The last version is for Moodle 2.1 but no more available on Moodle.org .....

Modifying the code is not a good idea, because it's too old. You'll certainly need to rewrite all the plugin ... not a good idea

I think this plugin is no more available until Moss development team produce a new version.
Best I can tell you is to contact Moss team to have informations about it

Good luck and have a nice day

OdyX pushed a commit to liip-elearning/moodle_local_ldap that referenced this issue Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants