Previous post populated when loading the ticket

Helpdesk for my helpdesk software

Moderator: mkoch227

plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Previous post populated when loading the ticket

Post by plc »

Since I upgraded to the latest version when I return to a ticket the comment box automatically gets populated with my previous response.
Is this just happening to me?
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Previous post populated when loading the ticket

Post by Klemen »

The new version auto-saves what you type into the "Reply" box.

However, when you submit the reply, the saved reply should be deleted.

If it is not, you probably had the same ticket opened in two browser windows (or don't have the admin/admin_reply_ticket.php file from the 3.4.3 version)?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

If it is not, you probably had the same ticket opened in two browser windows (or don't have the admin/admin_reply_ticket.php file from the 3.4.3 version)?

Definitely not two browser/tab. I did an overwrite per usual but perhaps that didn't go as intended. The rest of the system is working well so it would be odd for it to just be one file but I will overwrite that one file with a fresh copy and see.
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

Okay so at first glance, the zip *I have* doesn't even contain admin_reply_ticket.php so I definitely do not have the 3.4.3 version of that file. And this is from the original download I have of 342to343 update. I checked the full download for 343 and of course it does contain the file. Unfortunately I cannot find the 342to343 download to check that myself.
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

I overwrote admin_reply with a copy of the file from the full download and nothing has changed.

Once I do that, what should I do to ensure I am using the new file? I cleared my cache and logged out but it is still populating the previous comment.
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Previous post populated when loading the ticket

Post by Klemen »

Sorry for the late reply, I had work above my head...

To clean up some confusion - the admin_reply_ticket.php didn't change in version 3.4.3; the reply draft should be deleted in versions before that.

Can you give me access to your help desk (in a private message) to test a few things and try to see what is going wrong?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

No worries, better too busy than not enough!

Yeah I'll send you a PM.
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Previous post populated when loading the ticket

Post by Klemen »

Did a couple of tests. It seems like the issue is being caused by the slow server (and delays with sending emails):

1. When you stop typing, an asynchronous request is sent to the server to store the message
2. You click the "Submit reply" button before the async request from #1 is stored
3. The async request gets processed after the "submit" request deletes the data from the database, so the draft gets saved again

When I type in a response, wait a few seconds (for the async request to complete), and THEN hit the "Submit reply" button, it works normally.

The solution here would be to disable async saving, for example, by editing file /admin/save_ticket_draft_async.php - find

Code: Select all

define('IN_SCRIPT',1);
and ABOVE that add

Code: Select all

exit();
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

Implementing the suggested code did fix the issue. I've approached the host to see if I can workout what the performance issue is and was told that ModSecurity was generating errors and that would likely be the source. Still working on gathering more information about that so I can implement a long term reliable solution.

For the emails, you mentioned my SMTP connecting to a third party (gmail) causing that pause after submit is applied and that routing the mail through the localhost would be more efficient so I'll look into doing that as well.
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

On the SMTP issue I was quickly able to use the localhost to relay mail but now since it is relayed it is going to spam. I am getting a sender cannot authenticate the message (according to gmail). So I would need some help to decipher how to ensure the mail is authenticated. I am using TLS on the localhost and that is working. I'm guessing this has to do with domain keys/spf/dmarc setup although I'm fairly sure I have the fqdn of the localhost in there but I'll confirm that.
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Previous post populated when loading the ticket

Post by Klemen »

It really comes down to web hosting setup. If you want to use a custom "From" address, then the server (or mail server) will need to be set up to relay through that domain.

In Hesk Cloud, for example, we use Amazon SES to send emails. Emails are queued to localhost, then delivered by Exim through a connection to Amazon SES.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

Now that I am using localhost the submit function is lightning fast so that's good but (from my end at least) notifications are still labeled as spam.

I added the IP of the host in dns in my spf record but maybe there is more than that needed to authenticate the messages.
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

This is somewhat still related...Now that I have the SMTP set to localhost the site is working as expected BUT the emails are being labeled as spam.

My site host is not the same as my mail and DNS(SPF/DKIM/DMARC) hosts. So...99% of my mail is sent directly to my actual mail host and is easily authenticated and legitimized but now the mail coming from PHPmailer from Hesk is not. This is in spite of the IP of the site host being in the SPF record. And this latter part is where I'm getting confused. The host is telling me it is not the server I am on that would digitally sign the outgoing mail and that it would be configured in the php of the script sending the mail. To my knowledge, the mail should be relayed to google to deliver hence getting authenticated. But hesk isn't going that, it is directly delivering the mails which likely makes what the host is saying correct. Either way, as I mentioned, the site host is authorized to send the mail. I assume there is something I am not quite grasping here so if anyone has any insight I would greatly appreciate it.
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Previous post populated when loading the ticket

Post by Klemen »

I'm afraid setting p DKIM and SPF is outside of the scope of my support; this is something that needs to be configured on the server side, not in Hesk.

You can still use Hesk to send emails using Google as your SMTP server (this is what your host is probably referring to), but that will cause the delays you were experiencing because Hesk needs to connect to the SMTP server each time to send emails.

Note that you will not be able to send emails as @gmail.com from your own server, there is no way to DKIM sign and SPF validate @gmail.com emails from your server.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
plc
Posts: 89
Joined: Wed Jun 20, 2012 2:09 pm

Re: Previous post populated when loading the ticket

Post by plc »

I found the issue. I will make a detailed post in cast this helps someone get to this solution.
Post Reply