django-helpdesk icon indicating copy to clipboard operation
django-helpdesk copied to clipboard

Public update of ticket cannot be done properly.

Open cinmoy98 opened this issue 3 years ago • 10 comments

I figured out that after creating a ticket as a public ,it requires a key to update the ticket. I tried "is this update public" checkbox checked. Even I set the HELPDESK_UPDATE_PUBLIC_DEFAULT = True. But when I try update after viewing a ticket by providing ticket no. and email it redirects me to login page. I also tried HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE = True. But didn't work.

Problem 2: after creating the ticket as public there is key in the URL.(It seems a public can comment and update while he/she is on the current session after creating a ticket).In this case I was able to comment and update the ticket as public but it redirects me to example.com domain. screenshot . But when i go backward the comment is included in followups.

So, is there any way to update/comment the ticket as public after viewing a ticket by providing ticket no. and email? And what about the redirection to example.com page after updating ticket with key.

cinmoy98 avatar Feb 10 '22 06:02 cinmoy98

The public interface needs a lot of work, it wasn't updated much in our last release unfortunately.

Are you saying the public updates are not shown on the public ticket page? Just trying to better understand the issue. Thanks!

gwasser avatar Feb 10 '22 06:02 gwasser

@cinmoy98 Concerning your second problem, you may want to log into the admin and check your Site configuration. I suspect it is using example.com as for the host name. Just replace it by your host and the redirection will be correct.

As for the public interface, I don't use it in my project because I saw like you there were some bugs so yeah, it needs some rework I think..

Benbb96 avatar Feb 10 '22 08:02 Benbb96

@cinmoy98 Concerning your second problem, you may want to log into the admin and check your Site configuration. I suspect it is using example.com as for the host name. Just replace it by your host and the redirection will be correct.

As for the public interface, I don't use it in my project because I saw like you there were some bugs so yeah, it needs some rework I think..

Hi, How should a public ticket work?do I add it without logging in and then I can comment?

IvanovIvan1900 avatar Aug 13 '22 05:08 IvanovIvan1900

Ideally the public ticket would allow someone to submit a ticket, and receive a custom "secret" URL link in their email that allows them to view the ticket and add comments later without needing to create an account. The secret URL part already works, but the public interface needs overhauled to allow for comments and update checks.

gwasser avatar Aug 13 '22 06:08 gwasser

Ideally the public ticket would allow someone to submit a ticket, and receive a custom "secret" URL link in their email that allows them to view the ticket and add comments later without needing to create an account. The secret URL part already works, but the public interface needs overhauled to allow for comments and update checks.

  1. Maybe i read documentation for public ticket?
  2. The mailing of a letter with a secret key has already been implemented?

IvanovIvan1900 avatar Aug 13 '22 06:08 IvanovIvan1900

Yes, mailing the secret key already is implemented. The public user interface (UI) is old and needs updated with more features to make it fully functional.

gwasser avatar Aug 13 '22 06:08 gwasser

Yes, mailing the secret key already is implemented. The public user interface (UI) is old and needs updated with more features to make it fully functional.

ok. I will read the code, and if I can, I will try to help in solving problems

IvanovIvan1900 avatar Aug 13 '22 06:08 IvanovIvan1900

Also this is part of https://github.com/django-helpdesk/django-helpdesk/issues/1043?

Mte90 avatar Aug 13 '22 12:08 Mte90

Yes, mailing the secret key already is implemented. The public user interface (UI) is old and needs updated with more features to make it fully functional.

In this case, the email contains a url with & and this leads to the fact that the link from the email does not work if you replace & with & everything works correctly. Where is the error 1. When getting parameters from the url or when forming the url?

example

  • http://127.0.0.1:8000/view/?ticket=DH-11&email=ivanov%40mail.ru&key=d2d256c0-483d-49c6-b118-44f2f797136b - this is link is working
  • http://127.0.0.1:8000/view/?ticket=DH-11&[email protected]&key=d2d256c0-483d-49c6-b118-44f2f797136b - this is link in email, and didn't working both link for the same ticket

if use in template build in filter "safe" (example Вы можете перейти по следующей ссылке. {{ ticket.ticket_url|safe }}.) all work correct. maybe replace "{{ ticket.ticket_url }}" on "{{ ticket.ticket_url|safe }}" in code?

IvanovIvan1900 avatar Aug 14 '22 12:08 IvanovIvan1900

Also this is part of #1043?

I think these are related tasks. Thank you for the information

IvanovIvan1900 avatar Aug 15 '22 02:08 IvanovIvan1900

Just wanted to point out that commit 3d4d58b won't fix for existing sites using django-helpesk since it only changes the json which is used when seeding the database with fixtures.

The solution would be to run SQL query to replace occurrences of {{ ticket.ticket_url }} by {{ ticket.ticket_url|safe }} in the EmailTemplate table for fields plain_text and html. Something like :

UPDATE helpdesk_emailtemplate SET plain_text=REPLACE(plain_text, '{{ ticket.ticket_url }}', '{{ ticket.ticket_url|safe }}'), html=REPLACE(html, '{{ ticket.ticket_url }}', '{{ ticket.ticket_url|safe }}');

Benbb96 avatar Nov 27 '23 16:11 Benbb96