Course Module ID was incorrect

Course Module ID was incorrect

by Juan Manuel Reina Gil -
Number of replies: 5

Hi there!

It seems Certificate module is improving quickly these days and I'm really excited about it. I solved several problems reported in other posts thanks to the Pukunui branch of the module

But...

I'm having a problem every time I try to review the issued certificate for acertain student by clicking on the link I receive by e-mail.

The email says this:

(Student's name) has received his/her certificat: (Certificate's name)

You can review it here:
http://www.webpage/mod/certificate/report.php?id=129

When I click on the link I get this message:

Course Module ID was incorrect

More information about this error

The link to Moodle Docs says something about capabilities. It seems that I'll have to change the roles so teacher could see this but, having logged in as admin doesn't seem to allow me to access this certificate (or any of the other emails I have received).

Moodle version: Moodle 2.0.3+ (Build: 20110525)

Certificate version: PukunuiAustralia-moodle-mod_certificate-469799b

Any help?

Thanks in advance! 

Average of ratings: -
In reply to Juan Manuel Reina Gil

Re: Course Module ID was incorrect

by Chris Collman -
Picture of Documentation writers

This happens to me.  My theory is that Moodle looking a cookie (perhaps a session cookie) .   Moodle is basically telling us it is clueless as per your identity.  It does not know your role, thus you are not capable of viewing the certificate smile

I am guessing that the browser you are checking your email with, does not have an open window to Moodle.  

Did you try loging into your Moodle, then pasting the address link in your address bar?  

Hope this helps   Chris

In reply to Chris Collman

Re: Course Module ID was incorrect

by Jean-Michel Védrine -

Hello,

There is no session cookie involved in the process. The message you see in Moodle docs is in fact irrelevant to this issue. But most probably the id= part of the url is wrong.

The message is displayed because of the code in mod/certificate/report.php

    if (! $cm = get_coursemodule_from_id('certificate', $id)) {
            error('Course Module ID was incorrect');
    }

So we clearly see that the problem lies in the id parameter.

But some bugs related to this issue have been solved only a few days ago.

Can I ask people seeing this issue to :

  • download the very latest version from PukunuiAustralia (be sure to re-download it, don't use a version that you downloaded (even shortly) before.
  • try to replicate the problem with mails about certificates issued after the upgrade
  • if the problem is not solved go to Site Administration > Debuging and set level error messages to DEVELOPER
  • try to replicate the problem once more and copy the full error message
  • paste it in this forum replaying to that thread. It is very important to diagnoze the problem to get the full error message.

As you said I am quite impressed by the number of bugs corrected in the last weeks (and we must all thank Mark Nelson for that) so I want absolutely to be sure this bug is solved.

WARNING : any mail send before you upgrade will of course be still wrong even after the upgrade. So if one of these mail still has an incorrect link this is not a proof that the problem is not solved !

 

In reply to Juan Manuel Reina Gil

Re: Course Module ID was incorrect

by Jean-Michel Védrine -

Bingo !

As you says you have certificate version 469799b I was able to verify that you have a version made before bug CONTRIB-3212 was solved so there is a good probability that upgrading will solve your problem ! I hope so !

In reply to Jean-Michel Védrine

Re: Course Module ID was incorrect

by Juan Manuel Reina Gil -

Dear Jean-Michel:

I will try with the upgrade but I have to say that every single time I've read a post from you is like taking a whole course about Moodle. Your knowledge and competence to teach are superb!

Thanks in advance and will post if this did the trick.