Jump to content
persis

Whmcs version 8.3, updateclientdomain.php , not work

Recommended Posts

2 minutes ago, steven99 said:

Provide more info you can ? 

this code not work with updateclientdomain.php (v8.3) but work with updateclientdomain.php(8.1.2)

 

<?php

use WHMCS\Database\Capsule;

add_hook('AfterCronJob', 1, function($vars)
{
    $adminUsername = ''; // Optional for WHMCS 7.2 and later
    
    foreach (Capsule::table('tbldomains')->pluck('id') as $v)
    {
        localAPI('UpdateClientDomain', array('domainid' => $v, 'autorecalc' => true), $adminUsername);
    }

});

Share this post


Link to post
Share on other sites
        
 

Version:8.2.0 (8.2.0-release.1) not work

Version:8.1.3 (8.1.3-release.1) working

Share this post


Link to post
Share on other sites
On 7/11/2021 at 10:17 PM, steph.hope said:

There's no v8.3 yet.

Yes they is a 8.3 but in beta here

Share this post


Link to post
Share on other sites

You should use a return to see where is the issue:

$tesult = localAPI('UpdateClientDomain', array('domainid' => $v, 'autorecalc' => true), $adminUsername);

var_dump($result);

There will be a “result” and “message” if there is an issue. Or you will get “result: success” and API function is OK.

Share this post


Link to post
Share on other sites

array(2) {
  ["result"]=>
  string(5) "error"
  ["message"]=>
  string(267) "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where `id` = ?' at line 1 (SQL: update `tbldomains` set  where `id` = xxx)"
}

 

 

Share this post


Link to post
Share on other sites
2 minutes ago, persis said:

array(2) {
  ["result"]=>
  string(5) "error"
  ["message"]=>
  string(267) "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where `id` = ?' at line 1 (SQL: update `tbldomains` set  where `id` = xxx)"
}

 

 

Do the same for your query on Capsule. You are not providing id to the API.

Share this post


Link to post
Share on other sites

I manualy hide the ID when copying and pasting for you!

I think whmcs codes in this api cant work with mariadb 10.3! 

I am moving from mariadb to mysql for test...

Share this post


Link to post
Share on other sites
9 hours ago, persis said:

I manualy hide the ID when copying and pasting for you!

I think whmcs codes in this api cant work with mariadb 10.3! 

I am moving from mariadb to mysql for test...

I’m referring to the sql error. It’s not MariaDB

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated