Call to a member function addToCommand() on null in
Closed this issue · 7 comments
After trying to register a new domain we face error:
Error: Call to a member function addToCommand() on null in /*****/public_html/modules/registrars/ispapi/lib/AdditionalFields.php:1087
Stack trace:
#0 /*****/public_html/modules/registrars/ispapi/ispapi.php(2412): WHMCS\Module\Registrar\Ispapi\AdditionalFields::addToCMD(Array, Array)
#1 /*****/public_html/vendor/whmcs/whmcs-foundation/lib/Module/AbstractModule.php(0): ispapi_RegisterDomain(Array)
#2 /*****/public_html/vendor/whmcs/whmcs-foundation/lib/Module/Registrar.php(0): WHMCS\Module\AbstractModule->call('RegisterDomain', Array)
#3 /*****/public_html/includes/registrarfunctions.php(0): WHMCS\Module\Registrar->call('RegisterDomain', Array)
#4 /*****/public_html/includes/registrarfunctions.php(0): RegCallFunction(Array, 'RegisterDomain')
#5 /*****/public_html/admin/clientsdomainreg.php(0): RegRegisterDomain(Array)
#6 {main}
Hi @amingholami
would you mind providing the registrar module version in use? Find the version number in the Domain Registrars Overview as part of the module name.
Which PHP Version are you using? which WHMCS version?
Thanks!
I applied a patch to a single line of code that I expect to be problematic with WHMCS installations using an older version of PHP. Find it patched in v8.1.8. Hopefully this is matching your setup - that's everything we can do in lack of response. If you're still having trouble, let us know.
We had a type declaration issue in our software dependency.
https://github.com/hexonet/whmcs-ispapi-registrar/releases/tag/v8.1.9
Just to round this up: we are mainly developing for PHP 7.4.
The trouble you experience might also be related to using an older PHP version.
Hi, sorry for delay response,
After upgrade to latest version, here is the new error for registering an example .io domain extension:
PHP 7.2
WHMCS 7.7.0
Whoops\Exception\ErrorException: Declaration of CNIC\HEXONET\Response::getColumn($key): ?CNIC\HEXONET\Column must be compatible with CNIC\ResponseInterface::getColumn($key): ?CNIC\ColumnInterface in /public_html/modules/registrars/ispapi/lib/vendor/centralnic-reseller/php-sdk/src/HEXONET/Response.php:20
Stack trace:
#0 /public_html/vendor/whmcs/whmcs-foundation/lib/Utility/Error/Run.php(0): WHMCS\Utility\Error\Run->handleError(64, 'Declaration of ...', '/home/admin/dom...', 20)
#1 [internal function]: WHMCS\Utility\Error\Run->handleShutdown()
#2 {main}
ok, thanks. I guess, we have to remove the typings of returns types 'til WHMCS comes with PHP 8 support.
No over way around. We notice errors as well with PHP 7.4 actually on different OS than we use for testing.