-
Notifications
You must be signed in to change notification settings - Fork 52
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
use count to use check return by ->get() #101
base: master
Are you sure you want to change the base?
Conversation
i have fixed this issue before but i didn't make a PR. Can anyone test this code cause i don't have access to whmcs anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the code on a WHMCS installation and normally functionality for managing created servers is restored. This looks good from a testing perspective.
Open use count to use check return by ->get() vultr#101
@jazz7381 That works! You saved me a lot of headache! I was looking for a solution for 8.1.x version. Thanks! |
@jazz7381 - Thank you from all of us! |
glad to help |
@jazz7381 It doesn't work in 8.1.1 version now again :( |
@SaneChoice Did you update to WHMCS 8.1.1? Are you having issues? |
I am Still on 8.0.3 and It doesn't work anymore when it did before and i haven't changed anything. I think they are phasing out the API v1 so maybe they are shutting it down. Has anyone started on the API v2 version. I am dying over here lol |
I just started using Linode module, i bought one, less headaches to be honest. |
|
sorry but i don't have access to whmcs anymore |
@@ -377,12 +377,12 @@ private function addVMCustomFields($SUBID) | |||
->where('type', 'product') | |||
->where('relid', $this->params['packageid']) | |||
->where('fieldname', 'LIKE', 'subid|%')->get(); | |||
if ($customField) | |||
if (count($customField) > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed and actually breaks the logic flow in things when was debugging this thoroughly today
{ | ||
$customFieldValue = Capsule::table('tblcustomfieldsvalues') | ||
->where('fieldid', $customField[0]->id) | ||
->where('relid', $this->serviceID)->get(); | ||
if ($customFieldValue) | ||
if (count($customFieldValue) > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing here.
@@ -116,7 +116,7 @@ public static function getProductConfigOptions($productID, $field = 'all', $defa | |||
public static function customFields($productID) | |||
{ | |||
$result = DB::table('tblcustomfields')->where('fieldname', 'subid|Virtual machine ID')->where('type', 'product')->where('relid', $productID)->select('id')->get(); | |||
if (!$result) | |||
if (count($result) < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a good and necessary change needed for php72+ from what i can tell
@@ -490,7 +490,7 @@ public static function getAvailableIsos($isosList) | |||
public static function getUserScripts($clientID, $scripts) | |||
{ | |||
$allowScripts = Capsule::table('vultr_scripts')->where('client_id', $clientID)->get(); | |||
if (empty($allowScripts)) | |||
if (count($allowScripts) < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also good.
@@ -521,7 +521,7 @@ public static function getUserScripts($clientID, $scripts) | |||
public static function getUserSSHKeys($clientID, $keys) | |||
{ | |||
$allowKeys = Capsule::table('vultr_sshkeys')->where('client_id', $clientID)->get(); | |||
if (empty($allowKeys)) | |||
if (count($allowKeys) < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also good.
Description
Related Issues
#92
#88
Checklist: