whmcs-vultr icon indicating copy to clipboard operation
whmcs-vultr copied to clipboard

Fix lost control of new server created on whmcs 8.1.x

Open meramsey opened this issue 3 years ago • 4 comments

Description

Updated all deprecated //use Illuminate\Database\Capsule\Manager as Capsule;

To: use WHMCS\Database\Capsule;

As recommended by WHMCS. https://developers.whmcs.com/advanced/db-interaction/

Fixes Related Issues

https://github.com/vultr/whmcs-vultr/issues/88 vultr#91 vultr#92 vultr#105 vultr#106

Tested with latest WHMCS Version: 8.1.3 PHP 7.3 and PHP7.4 Centos 7

Please NOTE: That i have incorporated some, but NOT all of the fixes from https://github.com/vultr/whmcs-vultr/pull/101/ All original credit for those things should be attributed to @jazz7381 and that PR could most likely be closed as mine incoporates the working stuff from there and more.

Also included is a pretty extensive port of the VultrAPI class to V2 which is not in use yet but is pretty close to being able to be used.

It would be nice if this could be merged here in the official repository so it gets better attention from those in need of it vs hunting through forks and having to pick and pull the needed fixes.

The main issue appears to have been in addVMCustomFields where it was failing to add the subid to tblcustomfieldsvalues https://github.com/whattheserver/whmcs-vultr/commit/453c76e9de1fcebbed0a23671b1e0eb51e529f4a

This in turn causes the creation to fail and allows customers to keep trying to create servers they thought failed but are detached from the client area and costing the Reseller money and time wasted going to clean those up and reattaching only one to the account manually.

Feel free to remove the debugging commented out stuff before merging it was left to make it easier to see what was happening and so the behaviour can be reproduced and tested if desired.

Checklist:

  • [x ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • [ x] Have you linted your code locally prior to submission? Left some commented out stuff for clarification but can be removed upon review.
  • [x ] Have you successfully ran tests with your changes locally?

meramsey avatar Apr 12 '21 01:04 meramsey

@whattheserver I'm not sure if anyone from Vultr is still monitoring this repo. Are your changes in your fork on master? I might give it a go.

miguemely avatar Jul 03 '21 01:07 miguemely

@miguemely correct see new tagged release i made for this : https://github.com/whattheserver/whmcs-vultr/releases/tag/2.0.5

meramsey avatar Jul 03 '21 14:07 meramsey

Thank you very much for the work you've put into this, it's very appreciated. I'm trying to get it set up and it seems to mostly be working, however, I'm seeing some weird behavior on the products tab. I have about 3 products set up. I'm running WHMCS 8.2 image

ATommasi avatar Jul 13 '21 14:07 ATommasi

i have try use this update, but tblerrorlog in mysql still added every time, and make to many log DB

  • Creating default object from empty value on = modules/addons/vultr/mgLibs/MySQL/Query.php line:43
  • Invalid argument supplied for foreach() on = modules/addons/vultr/models/whmcs/service/customFields/Repository.php Line : 99 err_log

limsoke avatar Dec 15 '21 20:12 limsoke