Osticket: Can't merge tickets from ticket view

Created on 3 Jan 2020  路  11Comments  路  Source: osTicket/osTicket

We're having difficulties merging tickets.

Problems occurs when you go directly to a ticket and use the merge ticket function from the options menu.

Steps to reproduce:

  • Click on any ticket in the "Open" ticket queue. Haven't tried it with other queues but I assume problem is most likely not related to queues.

  • Go to "Merge tickets" (Option/Configuration icon -> "Merge tickets").
    ticket_merge

  • Use "Select ticket" to find an other ticket you wish to merge with and click "Add a ticket". Now you have 2 tickets in your overview.
    ticket_merge_2tickets

  • Click "Save changes".

Nothing will happen after that. Saving results in a (silent) 500 error and osTicket will redirect you to the ticket overview.

The actual error from the PHP-FPM error log:

`2020/01/03 09:11:05 [error] 29388#0: *231869 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function getMergeType() on null in /include/class.ticket.php:2531
Stack trace:

0 /include/ajax.tickets.php(389): Ticket::merge(Array)

1 /include/class.dispatcher.php(145): TicketsAjaxAPI->updateMerge('')

2 /include/class.dispatcher.php(38): UrlMatcher->dispatch('/merge', Array)

3 /include/class.dispatcher.php(120): Dispatcher->resolve('/merge', Array)

4 /include/class.dispatcher.php(38): UrlMatcher->dispatch('/tickets//...', NULL)

5 /scp/ajax.php(308): Dispatcher->resolve('/tickets//...')

6 {main}`

Using the merge function from the (open) ticket overview seems to be working fine (yay!). With this I mean selecting tickets by using the checkboxes and the brand new merge icon:
ticket_merge_from_overview

Server components (if needed):
nginx/1.17.7
PHP 7.2.24
mysql Ver 15.1 Distrib 10.3.11-MariaDB

Just let me know if more details are needed. :)

bug

All 11 comments

@berkenpies

I cannot replicate the same issue. Are you all the way up to date with v1.14.1? If not, please upgrade and retest.

Cheers.

running into the exact same issue with merges.

[Fri Jan 03 09:49:37.597024 2020] [php7:error] [pid 13348] [client 10.x.x.x:62386] PHP Fatal error: Uncaught Error: Call to a member function getMergeTack trace:\n#0 /include/ajax.tickets.php(389): Ticket::merge(Array)\n#1 /class.dispatcher.pinclude/class.dispatcher.php(38): UrlMatcher->dispatch('15924/merge', Array)\n#3 /include/class.dispatcher.php(120): Dispatcher-ispatcher.php(38): UrlMatcher->dispatch('/tickets/15924/...', NULL)\n#5 /scp/ajax.php(308): Dispatcher->resolve('/tickets/15924/.php on line 2531

image

@jhayn49

I assume that you copied the error wrong or something because getMergeTack is not a valid function in the codebase. Try to find the full error in your logs to ensure that it does not say getMergeTack. If it does then search the codebase for getMergeTack. If this function exists you must have customizations or something installed as I mentioned before, this is not a valid function in the core codebase.

Cheers.

I went back to replicate this and now I can't. It's merging correctly for me at the ticket view screen. Thanks for the quick reply. It looks like I'm okay now.

This was the error I had.

[Fri Jan 03 09:44:35.541116 2020] [php7:error] [pid 12667] [client :62310] PHP Fatal error: Uncaught Error: Call to a member function getMergeType() on null in /var/www/html/dev/ack trace:\n#0 /var/www/html/dev/tickets_dev/include/ajax.tickets.php(389): Ticket::merge(Array)\n#1 /var/www/html/dev/tickets_dev/include/class.dispatcher.php(145): TicketsAjaxAPI->updateMerginclude/class.dispatcher.php(38): UrlMatcher->dispatch('15893/merge', Array)\n#3 /var/www/html/dev/tickets_dev/include/class.dispatcher.php(120): Dispatcher->resolve('15893/merge', Array)\n#4 ispatcher.php(38): UrlMatcher->dispatch('/tickets/15893/...', NULL)\n#5 /var/www/html/dev/tickets_dev/scp/ajax.php(308): Dispatcher->resolve('/tickets/15893/...')\n#6 {main}\n thrown in /var/.php on line 2531, referer: https://[URL]/dev/scp/tickets.php?id=15893

For the record, I am encountering the exact same issue as the OP: merging tickets works from the Open Ticket page, but from the Ticket View page it fails silently and produces this Apache error:

mod_fcgid: stderr: PHP Fatal error: Call to a member function getMergeType() on null in /var/www/vhosts/redacted/include/class.ticket.php on line 2531, referer: https://redacted/scp/tickets.php?id=91

osTicket Version | v1.14.1 (f1e9e88)聽鈥斅犅燯p to date
Web Server Software | Apache
MySQL Version | 5.5.64
PHP Version | 5.6.40

I anticipate that @JediKev will point out that my PHP is outdated, which is certainly true.

So I've updated to 7.3.13.

Merging tickets from the Ticket View page still fails silently, although instead of the one error I now receive a flurry of them:

2020-01-04 14:24:44 | Error | xx.xx.xx.xx | POST /o/1.14.1/scp/ajax.php/tickets/230/merge HTTP/1.1 | Apache SSL/TLS access
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to a member function getMergeType() on null in聽/var/www/vhosts/redacted/include/class.ticket.php:2531, referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: Stack trace:, referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #0聽/var/www/vhosts/redacted/include/ajax.tickets.php(389): Ticket::merge(Array), referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #1聽/var/www/vhosts/redacted/include/class.dispatcher.php(145): TicketsAjaxAPI->updateMerge('230'), referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #2聽/var/www/vhosts/redacted/include/class.dispatcher.php(38): UrlMatcher->dispatch('230/merge', Array), referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #3聽/var/www/vhosts/redacted/include/class.dispatcher.php(120): Dispatcher->resolve('230/merge', Array), referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #4聽/var/www/vhosts/redacted/include/class.dispatcher.php(38): UrlMatcher->dispatch('/tickets/230/me...', NULL), referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #5聽/var/www/vhosts/redacted/scp/ajax.php(308): Dispatcher->resolve('/tickets/230/me...'), referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: #6 {main}, referer: https://redacted/scp/tickets.php?id=230 | Apache error
2020-01-04 14:24:44 | Warning | xx.xx.xx.xx | mod_fcgid: stderr: thrown in聽/var/www/vhosts/redacted/include/class.ticket.php聽on line 2531, referer: https://redacted/scp/tickets.php?id=230

@stevland

Your assumption of my response is incorrect. This shouldn鈥檛 be a PHP version issue. Instead I think it will be code related. I will need to do some testing to try and replicate this issue.

Cheers.

@JediKev Thanks for your quick response. I double-checked the version(s);

osTicket Version:
v1.14.1 (f1e9e88)

Web Server Software:
nginx/1.17.7

MySQL Version:
10.3.11

PHP Version:
7.2.24

@berkenpies @stevland

Okay, so your issue is you are clicking on the result that contains the Subject line and not the Ticket Number. The Subject line appearing in the typeahead results is actually a bug and shouldn't be used. If you click the Ticket Number instead you should be able to merge correctly.

We are going to create a patch for the subject line in results issue and post a link here once complete.

Cheers.

@berkenpies @stevland

Here you guys go! 馃榿

Cheers.

@JediKev seems to do the trick! I manually applied the fixes from #5386 to our setup and that seems to fix things. :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mlipok picture mlipok  路  5Comments

ghost picture ghost  路  6Comments

rachelsupport picture rachelsupport  路  5Comments

F3000 picture F3000  路  5Comments

Taps7734 picture Taps7734  路  5Comments