vultr / whmcs-vultr

Vultr Module for WHMCS
Apache License 2.0
95 stars 52 forks source link

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

Open meramsey opened 3 years ago

meramsey commented 3 years ago

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:

miguemely commented 3 years ago

@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.

meramsey commented 3 years ago

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

ATommasi commented 3 years ago

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

limsoke commented 2 years ago

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