openprovider / Openprovider-WHMCS-domains

Openprovider WHMCS Domain Module
42 stars 31 forks source link

[BUG] Something went wrong and we couldn't process your request. #322

Closed musakhalid closed 1 month ago

musakhalid commented 1 month ago

Describe the bug

Once we activate your module, we got this error on invoice page while customer trying to make payment, and once the openprovider folder is deleted everything works fine! The server is powered by PHP 8.1

Fatal error: Cannot redeclare getadminpermsarray() in unknown on line 0 Oops! Something went wrong and we couldn't process your request.

Please go back to the previous page and try again.

For additional assistance, please reference the WHMCS TroubleShooting Guide »

Whoops\Exception\ErrorException: Cannot redeclare getadminpermsarray() in unknown:0 Stack trace:

0 /home/***/public_html/**

Screenshot 2024-07-11 at 12-32-39 Oops! /vendor/whmcs/whmcs-foundation/lib/Utility/Error/Run.php(0): WHMCS\Utility\Error\Run->handleError(1, 'Cannot redeclar...', 'unknown', 0)

1 [internal function]: WHMCS\Utility\Error\Run->handleShutdown()

2 {main}

Server info:

sapillai commented 1 month ago

Hi @musakhalid,

Thank you for reporting the issue.

The function that's being declared twice getadminpermsarray is not part of the stock WHMCS installation and on a quick check, I don't see any reference of this function in our module code.

We tried to reproduce the problem on our WHMCS instances with PHP 8.1 and module version 5.8.0, but we couldn't. Could you please open a support ticket and provide following details so that we can check this further?

sapillai commented 1 month ago

Hi @musakhalid,

Our module developers checked the module code and they couldn't find any place where we use this function - getadminpermsarray(). Based on the information from developers, the function returns the list of permissions that you see when creating or editing a role

Example output

Array
(
    [1] => Main Homepage
    [3] => My Account
    [4] => List Clients
    [152] => List Users
    [153] => Delete Users
    ................
    ................

If you can open a support ticket and provide details mentioned in my last comment, we will be happy to check further to see why it occurs when activating the Openprovider module.