Jump to content

Oops errors to client showing debug and links to WHMCS?


Recommended Posts

I really don't want to see error messages being displayed to my clients linking them back to the WHMCS documentation. Does anyone know how to stop that from happening? i.e to display a generic message without the debug info? I've looked through the settings inside WHMCS and I don't believe I have anything set up to show the full PHP error / stack trace to the client . Maybe I'm wrong there?  I don't have General Settings > Other > Display Errors enabled.

To re-create this problem, you only need to do something as simple as this...

1. Masquerade as a client by clicking the "Login as Client" option from within the WHMCS admin area.

2. Edit the clients profile details changing the first letter of their Email address to uppercase - i.e if their Email address was john.smith@blah.com - change it to John.smith@blah.com

3. Try to submit the changes - you will get this....

Oops!

Something went wrong and we couldn't process your request.

Please go back to the previous page and try again.

If the problem persists, please contact us.

Back to Homepage

For additional assistance, please reference the WHMCS TroubleShooting Guide »

WHMCS\Exception\Model\UniqueConstraint: A "WHMCS\User\Client" record with "email" value "John.smith@blah.com" already exists. in /home/username/public_html/clients/vendor/whmcs/whmcs-foundation/lib/Model/Observer.php:0
Stack trace:
#0 /home/username/public_html/clients/vendor/whmcs/whmcs-foundation/lib/Model/Observer.php(0): WHMCS\Model\Observer->enforceUniqueConstraint(Object(WHMCS\User\Client))
#1 [internal function]: WHMCS\Model\Observer->updating(Object(WHMCS\User\Client))
#2 /home/username/public_html/clients/vendor/illuminate/events/Dispatcher.php(347): call_user_func_array(Array, Array)
#3 [internal function]: Illuminate\Events\Dispatcher->Illuminate\Events\{closure}(Object(WHMCS\User\Client))
#4 /home/username/public_html/clients/vendor/illuminate/events/Dispatcher.php(221): call_user_func_array(Object(Closure), Array)
#5 /home/username/public_html/clients/vendor/illuminate/events/Dispatcher.php(164): Illuminate\Events\Dispatcher->fire('eloquent.updati...', Array, true)
#6 /home/username/public_html/clients/vendor/illuminate/database/Eloquent/Model.php(1675): Illuminate\Events\Dispatcher->until('eloquent.updati...', Object(WHMCS\User\Client))
#7 /home/username/public_html/clients/vendor/illuminate/database/Eloquent/Model.php(1534): Illuminate\Database\Eloquent\Model->fireModelEvent('eloquent.updati...')
#8 /home/username/public_html/clients/vendor/illuminate/database/Eloquent/Model.php(1470): Illuminate\Database\Eloquent\Model->performUpdate(Object(Illuminate\Database\Eloquent\Builder), Array)
#9 /home/username/public_html/clients/vendor/whmcs/whmcs-foundation/lib/Client.php(0): Illuminate\Database\Eloquent\Model->save()
#10 /home/username/public_html/clients/clientarea.php(0): WHMCS\Client->updateClient()
#11 {main}

Link to comment
Share on other sites

3 minutes ago, Chris74 said:

Does anyone know how to stop that from happening?

you could edit the error template(s) - /templates/six (or custom)/error/internal-error.tpl as that will be the template generating the above output.... you can alter the content of that page, including removing the stacktrace.

<div class="error-container">
    <h1>Oops!</h1>
    <h2>Something went wrong and we couldn't process your request.</h2>
    <p>Please go back to the previous page and try again.</p>
    <p>If the problem persists, please <a href="mailto:{{email}}">contact us</a>.</p>
    <p class="back-to-home"><a href="{{systemurl}}">&laquo; Back to Homepage</a></p>
    {{environmentIssues}}
    <p class="debug">{{adminHelp}}<br/>{{stacktrace}}</p>
</div>
Link to comment
Share on other sites

Pretty bad that changing the case on an Email address causes such an error.  I discovered this when a client set up their account with uppercase characters in their Email address and then tried to change it later to lowercase, they couldn't do it and received this error.

It can be done successfully from the admin side though.

I guess this is really a bug. @WHMCS John maybe something you need to fix?

Also, I wonder why the error message is displayed when General Settings > Other > Display Errors is disabled?

Link to comment
Share on other sites

1 hour ago, Chris74 said:

Pretty bad that changing the case on an Email address causes such an error.  I discovered this when a client set up their account with uppercase characters in their Email address and then tried to change it later to lowercase, they couldn't do it and received this error.

I raised an eyebrow when you posted that occurring as I didn't think something so trivial should cause a visible error like that. 🙄

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @Chris74,

Staff with an active admin session will see this documentation link and stack trace. It is not shown to clients/public.

I've been able to reproduce this behaviour on my side to, so I've opened case CORE-14163 with the development team to display a more friendly message in future.

Once we resolve cases and push features they are available at our change log, here:

https://changelog.whmcs.com/

I apologize for the inconvenience, and appreciate your patience as we work to resolve this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated