openprovider / Openprovider-WHMCS-domains

Openprovider WHMCS Domain Module
43 stars 31 forks source link

[BUG] WHMCS local API DomainGetNameservers returns an empty array #343

Open simonklink opened 1 week ago

simonklink commented 1 week ago

No nameserver records are returned using the WHMCS internal API DomainGetNameservers call. You can reproduce this by executing the DomainGetNameservers API call: https://developers.whmcs.com/api-reference/domaingetnameservers/

This should return the nameservers that are configured for the domain at OpenProvider. { "result": "success", "ns1": "ns1.example.com", "ns2": "ns1.example.com" } The call is routed to the NameserverController get method: 'getNameservers' => 'NameserverController@get',

However this return a hardcoded empty array: https://github.com/openprovider/Openprovider-WHMCS-domains/blob/master/modules/registrars/openprovider/Controllers/System/NameserverController.php#L50

sapillai commented 4 days ago

Hi @simonklink,

Thank you for posting.

Can you please share following details?

simonklink commented 4 days ago

Hi @sapillai,

The module itself does not use this, but we do use the WHMCS localApi DomainGetNameservers call.

We have domains at several registrars and this call allows us to retrieve the domain nameservers with one call independent of where the domain is registered.

This was working in version 3.3, see the following code: https://github.com/openprovider/Openprovider-WHMCS-domains/blob/v3.3.1/modules/registrars/openprovider/Controllers/System/NameserverController.php#L41

But with the latest version we get an empty array. This does not allow us to determine whether the OpenProvider domains are using our nameservers or custom nameserver records.

sapillai commented 4 days ago

Hi @simonklink,

Thank you for providing details.

I can see that this was removed in version 3.3.3 (Apr 2, 2021) with the following comment.

image

I will check with our developers to see if restoring the old logic (which uses a separate API request to retrieve nameservers) is possible in newer module versions without affecting any existing functions.