Chris74 Posted January 8, 2020 Share Posted January 8, 2020 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} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 8, 2020 Share Posted January 8, 2020 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}}">« Back to Homepage</a></p> {{environmentIssues}} <p class="debug">{{adminHelp}}<br/>{{stacktrace}}</p> </div> 1 Quote Link to comment Share on other sites More sharing options...
Chris74 Posted January 8, 2020 Author Share Posted January 8, 2020 Excellent thank you. I wasn't ware there was a template for that! 0 Quote Link to comment Share on other sites More sharing options...
Chris74 Posted January 9, 2020 Author Share Posted January 9, 2020 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 9, 2020 Share Posted January 9, 2020 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. 🙄 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted January 10, 2020 WHMCS Support Manager Share Posted January 10, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.