nanodesigns / nanosupport

Create a fully featured Support Center in your WordPress setup without any third party dependency, completely FREE. Get a built-in Knowledgebase too. The plugin is available on WordPress.org repository:
https://wordpress.org/plugins/nanosupport/
GNU General Public License v2.0
50 stars 13 forks source link

Email link problem #31

Closed wptech68 closed 7 years ago

wptech68 commented 7 years ago

looks something is wrong with the link received by email notifications pointing to the ticket it links to something like http://domain.com/?post_type=nanosupport#038;p=4129 instead of the ticket link

mayeenulislam commented 7 years ago

Actually we couldn't recreate the same. :disappointed:

Local Server Test

pending-link-local

Remote Server Test

pending-link-server

The link to the ticket, in email, was used in two cases:

  1. Notifying about new ticket submission, and
  2. Notifying agent about their assignment in a ticket

With your report, we've checked the code and found that, the 1st one's good using the get_permalink() - a WordPress' core function to handle this. And with quick tests, we found no bug there. So the bug report seems too localized and need to be checked in that particular condition only.

But with your bug report we found a minor issue in 2nd one that, the hacky ns_get_pending_permalink() is not functioning as expected. So we fixed that particular code in response.

wptech68 commented 7 years ago

I actually received the "unfriendly" link as an administrator when a new ticket was created. Which php file is the one managing the emails? I will take a look to mine to see if I find something there

mayeenulislam commented 7 years ago

Please have a look here in includes/ns-email-functions.php.

It's using the WP Core get_permalink().

wptech68 commented 7 years ago

I guess that the permalink is generated "after" the ticket published, so thats the problem In my list of tickets I have 10 tickets with their own permalink (pretty links), however a recently submitted ticket that is still pending shows a link to http://domain.com/?post_type=nanosupport&p=4132 and is the only one with this structure, and I think is because it is "pending", and thats why the admin when receives the notification about a new ticket created receives this same type of link

also checked these links as support agent and final user, and all of them receive the correct permalink, is just the admin who gets the large link while the ticket is still pending, so 99% sure the permalink is generated "after" published, which makes sense

not a big problem since admin can deal with that, what I dont know is why the links ads the #038 as shown in the example link http://domain.com/?post_type=nanosupport#038;p=4129

mayeenulislam commented 7 years ago

We've a hacky pretty permalink structure for pending posts, but actually it doesn't work in most of the cases. Yes, the pretty permalink only appear while published.

The single case that was assigning #038 is surely a concern, but with no insight, like you, we're in deep ocean, you know. :neutral_face:

Let's not pray to happen this again. :smiley: But let's wait for another occurrence, so that we can have some clue to dig with.

mayeenulislam commented 7 years ago

Could you please inform us, whether that cause a wrong post link with #038;:

http://example.com/?post_type=nanosupport#038;p=4129

All the references I found saying, #038; is healthy and equivalent to & or &, and they won't break things ever.

wptech68 commented 7 years ago

http://example.com/?post_type=nanosupport#038;p=4129 opens a page listing all tickets as "recent articles" in a standard wordpress layout but http://example.com/?post_type=nanosupport&p=4129 works fine redirecting to the permalink for ticket 4129

probably is my server not recognizing the #038; as a &

mayeenulislam commented 7 years ago

You didn't share your server info. You can share all the necessary system status using the Plugin's "System Status" submenu under "NanoSupport".

Is it nginx?