🔴 January 2024 Alert: Forum support inactive!
New forum registration are currently closed.
Use GitHub discussions
.
  • Recent
  • Dark Theme
  • Login

UVdesk

  • Dark Theme
  • Login
  • Search
  • Recent
  1. Home
  2. far2
F
  • Profile
  • Following 0
  • Followers 0
  • Topics 0
  • Posts 2
  • Best 2
  • Controversial 0
  • Groups 0

far2

@far2

2
Reputation
3
Profile views
2
Posts
0
Followers
0
Following
Joined 17 Nov 2023, 13:06 Last Online 29 Jan 2024, 17:25

far2 Unfollow Follow

Best posts made by far2

  • RE: Ticket Count showing zeros

    Hi,

    We had the same issue, all of a sudden the counts started showing zeroes. We tracked it down to a ticket where the subject had been written to the database as null, and some javascript which was trying to truncate the subject to < 300 characters. The js couldn't truncate null, so it crashed.

    We fixed it by editing two files:

    Change line 409 of vendor/uvdesk/mailbox-component/Services/MailboxService.php

    From:
    'subject' => $emailParser->getHeader('subject') != false ? $emailParser->getHeader('subject') : null,
    
    To:
    'subject' => $emailParser->getHeader('subject') != false ? $emailParser->getHeader('subject') : "No Subject",
    

    This writes "No Subject" to the subject column in the database instead of null.

    Then change line 1361 of vendor/uvdesk/core-framework/Resources/views/ticketList.html.twig

    From:
    <%- subject && subject.length <= 300 ? subject : subject.substr(0, 300) + '...'  %>
    
    To:
    <%- subject && subject.length <= 300 ? subject : (subject == null ? 'No Subject' : subject.substr(0, 300) + '...')  %>
    

    This prevents the ticket page from crashing if there are any existing tickets with null subjects, and will display "No Subject" instead.

    posted in Bug Report
    F
    far2
    17 Nov 2023, 13:36
  • RE: Ticket Count showing zeros

    @peopleinside

    My apologies, the original line is the one listed as line 410 in that file:

    $mailData['subject'] = $parser->getHeader('subject');
    

    I must have a different version of that service file on my server.

    The appropriate change for that version of the file would be to change the line above to:

    $mailData['subject'] = $parser->getHeader('subject') !== null ? $parser->getHeader('subject') : 'No Subject';
    
    posted in Bug Report
    F
    far2
    17 Nov 2023, 18:07

Latest posts made by far2

  • RE: Ticket Count showing zeros

    @peopleinside

    My apologies, the original line is the one listed as line 410 in that file:

    $mailData['subject'] = $parser->getHeader('subject');
    

    I must have a different version of that service file on my server.

    The appropriate change for that version of the file would be to change the line above to:

    $mailData['subject'] = $parser->getHeader('subject') !== null ? $parser->getHeader('subject') : 'No Subject';
    
    posted in Bug Report
    F
    far2
    17 Nov 2023, 18:07
  • RE: Ticket Count showing zeros

    Hi,

    We had the same issue, all of a sudden the counts started showing zeroes. We tracked it down to a ticket where the subject had been written to the database as null, and some javascript which was trying to truncate the subject to < 300 characters. The js couldn't truncate null, so it crashed.

    We fixed it by editing two files:

    Change line 409 of vendor/uvdesk/mailbox-component/Services/MailboxService.php

    From:
    'subject' => $emailParser->getHeader('subject') != false ? $emailParser->getHeader('subject') : null,
    
    To:
    'subject' => $emailParser->getHeader('subject') != false ? $emailParser->getHeader('subject') : "No Subject",
    

    This writes "No Subject" to the subject column in the database instead of null.

    Then change line 1361 of vendor/uvdesk/core-framework/Resources/views/ticketList.html.twig

    From:
    <%- subject && subject.length <= 300 ? subject : subject.substr(0, 300) + '...'  %>
    
    To:
    <%- subject && subject.length <= 300 ? subject : (subject == null ? 'No Subject' : subject.substr(0, 300) + '...')  %>
    

    This prevents the ticket page from crashing if there are any existing tickets with null subjects, and will display "No Subject" instead.

    posted in Bug Report
    F
    far2
    17 Nov 2023, 13:36