G'day all.Long time user of osTicket. Thanks to all.OS = Ubuntu 16.04.2 LTSPHP = 7.0.20MySQL =  10.0.31ApacheosTicket = v1.10 (901e5ea)Issue is that whenever I edit anything on the ticket (using the edit capability top right corner of each response or internal note) it comes back with a DB error #1062 and the edit window just hangs. A forced refresh of the webpage shows the edit was successful (although I would have thought that the edit would work in place of the original (sort of like Facebook does for comments) rather then show a completely new one below).Here is the email that I get:Duplicate entry '7201-926-H' for key 'file-type'<br /><br />---- Backtrace ----<br />#0 (root)/include/mysqli.php(204): osTicket->logDBError('DB Error #1062', '[UPDATE `osti_a...')<br />#1 (root)/include/class.orm.php(3133): db_query('UPDATE `osti_at...', true, true)<br />#2 (root)/include/class.orm.php(1304): MySqlExecutor->execute()<br />#3 (root)/include/class.orm.php(1966): QuerySet->update(Array)<br />#4 (root)/include/class.thread_actions.php(169): InstrumentedList->update(Array)<br />#5 (root)/include/class.thread_actions.php(201): TEA_EditThreadEntry->updateEntry()<br />#6 (root)/include/class.thread_actions.php(108): TEA_EditThreadEntry->trigger__post()<br />#7 (root)/include/class.thread.php(1461): TEA_EditThreadEntry->trigger()<br />#8 (root)/include/ajax.tickets.php(1092): ThreadEntry->triggerAction('edit')<br />#9 (root)/include/class.dispatcher.php(145): TicketsAjaxAPI->triggerThreadAction('906', '7197', 'edit')<br />#10 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('906/thread/7197...', Array)<br />#11 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('906/thread/7197...', Array)<br />#12 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/tickets/906/th...', NULL)<br />#13 (root)/scp/ajax.php(262): Dispatcher->resolve('/tickets/906/th...')<br />#14 {main}Regards,Steven SwartsTechCare

Well, file-type is a unique index on the attachment table, so it's just saying that you can't have two things with the same object_id & file_id & type. I'm not sure how you or it did that.. Might be one for the Dev's, perhaps create a bug-report on github?

Cheers for the comment Grizly, but I have done nothing out of the ordinary. I update to each stable release and work within the confines of that. I don't know why there would be a duplication of the same unique id in the database.

Seems it's failing when moving the attachments to the new entry..         // Move the attachments to the new entry        $old->attachments->update(array(            'object_id' => $entry->id        ));Works on mine.. odd.

Hmmm. That is interesting.Can you tell me the file(s) that call that? I might just replace all of them with fresh copies.

https://github.com/greezybacon/osTicket-1.8/commit/907ec36bd9f8c37c38c34b510b5af4e3ae26fd2a

Cheers @[deleted]01, @[deleted], that would be include/class.thread_actions.php

Cheers guys.I went and replaced all the old files with the latest from Github... Now my cron job provides this error:PHP Warning:  Declaration of AssignmentForm:($options) should be compatible with Form:($staff = true, $title = false, $options = Array) in /home/USERNAME/public_html/support/include/class.forms.php on line 4367PHP Warning:  Declaration of TransferForm:($options) should be compatible with Form:($staff = true, $title = false, $options = Array) in /home/USERNAME/public_html/support/include/class.forms.php on line 4487I did test editing and no errors showed on the screen anymore, it showed the changes immediately. But then I receive this via email due to issues with the cron rule.

Found this which is exactly the issue:https://github.com/osTicket/osTicket/issues/3300http://www.forum.osticket.com/d/discussion//v1-10-php-7-warning

Is this what I have to do?https://github.com/osTicket/osTicket/pull/3349/commits/bde15e2acec29a26c73918ae17aa0774fb5048c4

So far so good. I can confirm since making those changes I have had no emails come in with errors. I've attempted to edit all types of options (Internal Notes, User Notes, Responses).

Great!  Should I mark this thread as resolved and close it then?

Yes please.Can the Dev's please merge these pull requests?

I've passed along the request.

Write a Reply...