Support System Invalid Ticket message

I am getting an error when certain users create tickets. They show up in the list on the Support Ticket Manager page, but when I click to an individual one, I get "Error: Invalid Ticket Selected". This only seems to happen with certain users and the problem seems to be that no message ends up in the messages table.

Saw a couple posts about this error message a while back but the only answer was to try reinstalling and using the sql.txt file. But there is no longer a sql.txt file in the download.

Any suggestions?

using 1.5.4


  • Marty Thornley
    • Site Builder, Child of Zeus

    It seems to happen for this user every time.

    The only thing I can think that has changed is that I was using Super Cache for a while. It is now disabled and other users have create tickets.

    A disclaimer though - not many people using the system yet. I will be testing with some fake user names tonight.

    Any chance the caching is doing something? All the database tables are there and work fine most of the time. I actually received the email message from the broken tickets as they were created, yet they were never inserted into the messages table.

  • Marty Thornley
    • Site Builder, Child of Zeus

    Okay, have some updates...

    Tried with and without caching - not a factor. User still had the same problem.
    Tried new admin user on that blog to test the blog - not a problem, ticket worked fine.
    Tried logging in as that user - posted fine.
    Then had that user login and they posted. Again it was fine.

    Now I am really confused. It seems to happen sometimes but not all the time and I have not been able to recreate it outside of the times this one user and one blog has experienced it.

    When it breaks, the ticket is submitted fine. The email is sent fine. But the message does not show up in the database. So when you try to view the ticket it shows as invalid because you are pulling all that info from the database at once, so if any of it is wrong, it breaks.

    It doesn't seem to be possible, since you check the message first but it is happening. ??

    Some ideas...

    Maybe break up that pull from the database so you could test the ticket, then pull messages related to that ticket and test that? That way if message was lost, at least they can view the ticket and try adding another message. Right now it breaks and looks like the ticket doesn't exist.

    Attaching screenshots of the database tables so you can take a look.

    tickets 19,20,22 are the ones not working. The rest all worked fine.

  • Marty Thornley
    • Site Builder, Child of Zeus

    Messages don't seem strange. Content is below, only edited Ip addresses to xxx's and some folder structure as well to xxx's. Other than that, just a copy and paste.

    You might notice the text is formatted a little strange. I added a few tweaks to format it a little nicer, running it through wpautop, then replacing paragraphs with line breaks. Like so:

    $message = strip_tags($_POST['message']);<br />
    $message = wpautop($message);<br />
    $message = str_replace ('<p>','',$message);<br />
    $message = str_replace ('</p>','\r\n',$message);<br />
    $message = stripcslashes ($message);

    I am pretty sure I made these changes after seeing the problem. But now that you mention characters... that did add a

    <br />

    to each of these broken tickets. Would that cause an issue?

    Here are the messages:

    id19: ---------------------------

    ericv said:

    Heya Marty,

    Hope all is well. I pointed my domain at your new server Ip's
    I just wanted to mention that in the domain mapping area in the admin it still says the old Ip # Just a heads up.


    id20: ---------------------------

    ericv said:

    Heya Marty,

    Hope all is well. I'm getting a message saying "Free trial period expires: Go to your Blog Account page to activate a subscription plan."
    And as well across the top of the admin area: Warning: date() expects parameter 2 to be long, string given in /xxx/xxx/xxx/wp-content/mu-plugins/payment-plans/functions/functions-general.php on line 17

    What should I do?


    id21: ---------------------------

    ericv said:

    Hey Marty,

    Check sites. All sites are way slow to load. Not just mine. all takes minutes. It's not my connection all other internet sites checking out fast as normal. Just a heads up. Im going to email this to you as well to make sure you get it.

    Second note: I'm note seeing the new (or old) goggle analytics under the settings sidebar. Maybe you are still tweaking it. And awesome that it doesn't track admin and personal visits... way cool.


  • Marty Thornley
    • Site Builder, Child of Zeus

    Thanks! That looks like the fix I imagined, with something to cover an error in the user id. I'll let you know if i find anything else.

    A couple other notes...

    I have added a little explanation to the invalid ticket message. I feel like there is confusion when the ticket is listed but when you click on on it and see "Invalid Ticket". So I think adding something like "It appears there was a problem with this ticket. Please try submitting a new one." might make things smoother, especially with this fix. Hopefully they resubmit and it works.

    Seemed to be an extra function in there: incsub_support_tickets_output() was pretty much a duplicate of incsub_support_output_tickets() but was not being called from anywhere.

    Only other thing - I tested so many tickets to do this. Would be great to be able to just delete a ticket. :slight_smile:

    Thanks again for the quick response!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.