Jump to content
altomarketing

Can i customize "Error: File not found. Please contact support." ?

Recommended Posts

Hi ! we had been using Whmcs for 7 years, so we removed old downloads files from hosting to save space.. we are designers , so we save almost a Tera of space , keeing only attachment from last 12 months.

But  if a customer tries to open an attachment in ticket from 2016 for example, it gives the error

Quote

 

Oops!

Something went wrong and we couldn't process your request. Please go back to the previous page and try again.  Error: File not found. Please contact support.

 

 

How can i customize this screen, and translate it ?

 

Share this post


Link to post
Share on other sites
12 hours ago, altomarketing said:

How can i customize this screen, and translate it ?

possibly with difficulty!

I think it's hardcoded in the encrypted files and therefore out of reach to easy changes - there is a template @ /templates/six/error/internal-error.tpl which mirrors the output, but editing it seems to make no difference to the output (unless i'm generating the wrong error type)... so I don't even think it's being called... in any event, it looks like it wouldn't support language strings, so even if you could edit it, you may have to hardcode it into Spanish...

14 hours ago, altomarketing said:

we removed old downloads files from hosting to save space.. we are designers , so we save almost a Tera of space , keeping only attachment from last 12 months.

did you just delete the attachments via FTP, or did you prune them via the System Cleanup page ??

https://docs.whmcs.com/System_Utilities#System_Cleanup

Quote

Prune Old Attachments

Select a date and any support ticket attachments uploaded before that date will be removed from the ticket and also deleted from the /attachments directory.

I should add that I quickly tested this in a v7.7 dev and from what I can see, it's only deleting the file from the attachments directory and is NOT removing the link to it from the ticket itself (which if you pruned the attachments might explain your error) - now I don't know if this is a bug or there is a configuration error at my end... but it doesn't seem to be working in the latest version as the documentation describes. 🙄

if this is bugged, then you could run a SQL query to remove the attachments from the database before a specific date...

UPDATE tbltickets, tblticketreplies
SET tbltickets.attachment = NULL, tblticketreplies.attachment = NULL
WHERE tbltickets.date < '2018-01-01' OR tblticketreplies.date < '2018-01-01'

or if you wanted to remove tickets from before one year ago today...

UPDATE tbltickets, tblticketreplies
SET tbltickets.attachment = NULL, tblticketreplies.attachment = NULL
WHERE tbltickets.date < DATE_SUB(NOW(), INTERVAL 1 YEAR) OR tblticketreplies.date < DATE_SUB(NOW(), INTERVAL 1 YEAR)

although i'd always recommend taking a backup of the database before running any such queries - better safe than sorry! ⚠️

with the links removed between the ticket and attachment(s), any links to them should not be shown in viewticket.php and hopefully resolve the error that you're seeing.

Share this post


Link to post
Share on other sites
6 hours ago, brian! said:

did you just delete the attachments via FTP

yes

6 hours ago, brian! said:

and is NOT removing the link to it from the ticket itself

No, i dont want to remove the link from ticket, as all i had erased from server, its in a backup server, just in case a customer or staff claims for this attachment, will manually look for it.. just in case...

Thats why i want to customize this message, looks creepy like my whmcs is broken.

 

6 hours ago, brian! said:

I think it's hardcoded in the encrypted files

🤷‍♂️ What a pity !  I will look further and write here if i find any solution. 🙋‍♂️

Share this post


Link to post
Share on other sites
On 04/04/2019 at 22:01, altomarketing said:

No, i dont want to remove the link from ticket, as all i had erased from server, its in a backup server, just in case a customer or staff claims for this attachment, will manually look for it.. just in case...

I suspect it's going to be easier to attack the issue from this end rather than trying to edit the encrypted output - even if you just remove the link in the client area via a hook (e.g if attachment date is before date you removed files via ftp or file doesn't exist)... a link that causes an error is a link not worth showing (if you can't easily fix the error displayed!). 🙂

On 04/04/2019 at 22:01, altomarketing said:

Thats why i want to customize this message, looks creepy like my whmcs is broken.

you're right - it does. 😱

On 04/04/2019 at 22:01, altomarketing said:

What a pity !  I will look further and write here if i find any solution.

I wish you well! 🙂

Share this post


Link to post
Share on other sites

Had the same issue with deleted invoices (Oops Invoice ID not found) in backend and frontend. I managed to override this page with my own by implementing a script that detects if the invoice exists and performs a redirect to my better looking page.

The key is that you need to place this script in a weird place. It should go in an action hook but not inside an hook point. It must be placed at the same "level" where you load classes. Let me know if it's not clear. I could provide an example when I get home.

Edited by Kian

Share this post


Link to post
Share on other sites

I am afraid that the functionality you're looking for here is not something that is currently offered by WHMCS. However I can see how displaying the affected file name could be useful.  Therefore I would encourage you to please submit a request to our feature requests tracker where other users can contribute to and vote on your idea. Ideas with the most votes and activity do get reviewed by our team.

http://requests.whmcs.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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