Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Keith C -
Number of replies: 7

Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.


I am getting this error upon entering a course after upgrading to the most current Moodle.  I understand the message is telling me a method has been depreciated but I don't know how to go about fixing it.  Any ideas.

Average of ratings: -
In reply to Keith C

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Ken Task -
Picture of Particularly helpful Moodlers

Upgraded from what version to 2.9.1?

In the lib/ directory of a 2.9.1 code folder there is an upgrade.txt file that has a section

DEPRECATIONS:
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices and will be removed in a future release (target: 2.8), a summary follows:

In Misc:
    * filter_text()                         -> format_text(), format_string()...
    * httpsrequired()                       -> $PAGE->https_required()
    * detect_munged_arguments()             -> clean_param([...], PARAM_FILE)
    * mygroupid()                           -> groups_get_all_groups()

You might have fallen victum to hyperjumping. :\

Do you have any *addon* plugin in the old system (the one you upgraded from) that related to 'mygroup' or groups?

'spirit of sharing', Ken

In reply to Ken Task

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Keith C -

Well that's a good question.  I think it was some iteration of 2.6.


And that is my question too....how to tell what old plugin lol. 



In reply to Keith C

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Keith C -

It looks to me like mygroupid()  only appears in a depreciated library and throws and error right there...but it's never called from anywhere else.  I searched the code the function only exists in the one spot and throws an exception.  I commented out the entire function and I can enter the course.  I guess I don't understand if the function is never called why did the exception fire?

In reply to Keith C

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You could also switch Debugging right up to developer and reproduce the error again. That will give you a trace of it being called.

My bet is that you have a plugin that calls get_current_group. This is also in deprecatedlib.php but does not throw a warning. BUT... it does call mygroupid() which (as you found out) does.

So, either find what called get_current_group() or do the trace.

I have a feeling that I submitted a bug about this...

EDIT:
I submitted one very similar, not this. However, I have now - MDL-50818

In reply to Howard Miller

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Ed Main -

Phew . . . just upgraded from 2.81 to 2.91 and was presented with the same ("Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.") error message. Turned on debugging and among there was reference being made to a plugin . . . deleted the plugin and now all is well . . . thanks! smile 

In reply to Ed Main

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Fiona Graham -

I am also getting this error after upgrading to 2.9.1. 


@ Ed: Can you tell me which pluggin you removed?


Thanks,


In reply to Fiona Graham

Re: Coding error detected, it must be fixed by a programmer: mygroupid() can not be used any more, please use groups_get_all_groups() instead.

by Fiona Graham -

I had to turn on debugging for developers before I found the pluggin name that was giving me problems.  It happened to be the FN marking block. Once I removed that my problem went away.