× How To / General

return error when publish CB joomdle my certificate plugin

6 years 4 months ago 6 years 4 months ago by saman سامان.
saman سامان
Posts: 253
More
Topic Author
return error when publish CB joomdle my certificate plugin #1
hi
when i use cb joomdle my certificate and publish that ,then i give this error:

XML-RPC Error (95042507): خطا در خواندن از پایگاه داده | DEBUG INFO: Table 'mydatabasename_demo2.mdl_certificate' doesn't exist SELECT c.name, c.id, ci.timecreated as certdate FROM mdl_certificate c LEFT JOIN mdl_certificate_issues ci ON c.id = ci.certificateid WHERE ci.userid = ? AND c.course IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ORDER BY ci.timecreated DESC [array ( 0 => '4', 1 => '20', 2 => '30', 3 => '21', 4 => '9', 5 => '23', 6 => '22', 7 => '14', 8 => '12', 9 => '11', 10 => '10', 11 => '8', 12 => '2', 13 => '15', 14 => '13', 15 => '3', 16 => '7', )] | ERRORCODE: dmlreadexception


it seems ci is problem in the sql or persian character render as ? ... i don't know what happen but it was work.

Please Log in or Create an account to join the conversation.

6 years 4 months ago
saman سامان
Posts: 253
More
Topic Author
return error when publish CB joomdle my certificate plugin #2
ok...problem solved, cause of that is ???? related to some unicode in the past set...

Please Log in or Create an account to join the conversation.

6 years 3 months ago
Antonio Durán
Posts: 7717
More
return error when publish CB joomdle my certificate plugin #3
Hi.
I don't know... the message says the certificate table does not exist.

Please Log in or Create an account to join the conversation.

5 years 5 months ago
saman سامان
Posts: 253
More
Topic Author
return error when publish CB joomdle my certificate plugin #4
hi again after 10 monuth



i get this error when i use cb joomdle my certificate plugin:
XML-RPC Error (95042507): Error reading from database | DEBUG INFO: Table 'bitnami_moodle.mdl_certificate' doesn't exist SELECT c.name, c.id, ci.timecreated as certdate FROM mdl_certificate c LEFT JOIN mdl_certificate_issues ci ON c.id = ci.certificateid WHERE ci.userid = ? AND c.course = ? ORDER BY ci.timecreated DESC [array ( 0 => '47', 1 => '2', )] | ERRORCODE: dmlreadexception

this error occur when you have not any certificate and go to the profile page of CB. for resolve this problem after some hours that spend on joomdle CB certificate plugin, i do below work and solve it. please say me is my work is correct or not?
i do this in line 47 of cbmycertificates.php :
if (!$this->certs)
		{
			// $username = $user->get('username');
// file_put_contents('C:\Users\work\AppData\Roaming\xampp\htdocs\XXX_my_certificates_simple.txt','-------(getTabTitle)normal' . PHP_EOL,FILE_APPEND);
			// $this->certs = JoomdleHelperContent::call_method ("my_certificates", $username, 'normal');
            $this->certs = array();
		}
when we have not any cert type in moodle , these lines switch with 'normal' selecet case and it select mdl_certificate table use auth.php but it is not exist in my moodle.
for replicate this problem you can simply install this plugin in moodle and login with user that not have any certificate and then go to cb profile...

Please Log in or Create an account to join the conversation.

5 years 5 months ago
Antonio Durán
Posts: 7717
More
return error when publish CB joomdle my certificate plugin #5
Thanks for the report, bu it is assumed that you need to install appropiate certificate module in Moodle for CB plugin to work.
We don't do any checks, because that would need calling Moodle. XMLRPC error is explanatory enough, if you enable the CB certificate plugin by mistake.

Please Log in or Create an account to join the conversation.

5 years 5 months ago 5 years 5 months ago by saman سامان.
saman سامان
Posts: 253
More
Topic Author
return error when publish CB joomdle my certificate plugin #6
i use simple certificate plugin in my moodle and set correctly in the joomla settings. you can test that. for replicate the problem you can :
1-install simple certificate in moodle
2-create simple certificate activity in moodle course and empty or testing certificate
3-set correct setting for simple certificate in joomla>CB plugin
4-login to joomla and go to cb-profile menu.
note: your testing user must not have any certificate

Please Log in or Create an account to join the conversation.

5 years 5 months ago
Antonio Durán
Posts: 7717
More
return error when publish CB joomdle my certificate plugin #7
Sorry, I did not understand what you said. You are totally correct. Thanks for taking the time to make me see the problem.
Please try this:
in file cbmycertificates.php , replace getTabTitle by this one:
    public function getTabTitle( $tab, $user, $ui, $postdata )
    {
        $plugin     =   cbarticlesClass::getPlugin();
        $viewer     =   CBuser::getMyUserDataInstance();

        $params = $this->params; // get parameters (plugin and related tab)
        $cert_type = $params->get('certificate_type');

        if (!$this->certs)
        {
            $username = $user->get('username');
            $this->certs = JoomdleHelperContent::call_method ("my_certificates", $username, $cert_type);
        }
        $total = count ($this->certs);

        return parent::getTabTitle( $tab, $user, $ui, $postdata ) . ' <span class="badge badge-default">' . (int) $total . '</span>';
    }

Please Log in or Create an account to join the conversation.

5 years 5 months ago 5 years 5 months ago by saman سامان.
saman سامان
Posts: 253
More
Topic Author
return error when publish CB joomdle my certificate plugin #8
ok ... i was thinking that you are not accept my report... ok your code is better than me where you use $cert_type in this line:
$this->certs = JoomdleHelperContent::call_method ("my_certificates", $username, $cert_type);

Please Log in or Create an account to join the conversation.

5 years 5 months ago
Antonio Durán
Posts: 7717
More
return error when publish CB joomdle my certificate plugin #9
Thanks, good to know it is working. We'll release a new version of the plugin soon with the fix.

Please Log in or Create an account to join the conversation.

5 years 5 months ago
saman سامان
Posts: 253
More
Topic Author
return error when publish CB joomdle my certificate plugin #10
if is it posible, please say my name.thank you

Please Log in or Create an account to join the conversation.