Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

DB Error - Inserting picture in topic

Hey Osticket.

I have upgraded to 1.10 i just recived this DB error when inserting pictures into a reply.

[INSERT INTO `ostNy_attachment` SET `file_id` = 584,
`type` = 'D', `object_id` = 18697, `name` = 'screenshot-mb4E']
Duplicate entry '18697-584-D' for key 'file-type'<br
/> <br />
---- Backtrace ----<br />
#0 (root)/include/mysqli.php(204):
osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />
#1 (root)/include/class.orm.php(3133): db_query('INSERT
INTO `os...', true, true)<br />
#2 (root)/include/class.orm.php(597):
MySqlExecutor->execute()<br />
#3 (root)/include/class.attachment.php(161):
VerySimpleModel->save()<br />
#4 (root)/include/ajax.draft.php(101):
GenericAttachments->upload(Array)<br />
#5 (root)/include/ajax.draft.php(300):
DraftAjaxAPI->_uploadInlineImage(Object(Draft))<br />
#6 [internal function]:
DraftAjaxAPI->uploadInlineImage('18697')<br />
#7 (root)/include/class.dispatcher.php(145):
call_user_func_array(Array, Array)<br />
#8 (root)/include/class.dispatcher.php(38):
UrlMatcher->dispatch('18697/attach', Array)<br />
#9 (root)/include/class.dispatcher.php(120):
Dispatcher->resolve('18697/attach', Array)<br />
#10 (root)/include/class.dispatcher.php(38):
UrlMatcher->dispatch('/draft/18697/at...', NULL)<br />
#11 (root)/scp/ajax.php(262):
Dispatcher->resolve('/draft/18697/at...')<br />
#12 {main}

Server Information
osTicket Versionv1.10 (901e5ea) —  Up to date
Web Server SoftwareApache/2.2.22 (Debian)
MySQL Version5.5.52
PHP Version5.5.38-1~dotdeb+7.1

«1

Comments

  • It says duplicate entry '18697-584-D'

    Do you have two attachments of the same size and filename on the same ticket?
  • Well im making a C/P from snipping tool, so it could easily be the same temp name. 

    I'll try to save the images first and see if samething happen.
  • This problem also happens when i c/p from excel.

    [INSERT INTO `ostNy_attachment` SET `file_id` = 588,
    `type` = 'D', `object_id` = 18719, `name` = 'screenshot-poZD']

     

    Duplicate entry '18719-588-D' for key 'file-type'<br
    /> <br />

    ---- Backtrace ----<br />

    #0 (root)/include/mysqli.php(204):
    osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />

    #1 (root)/include/class.orm.php(3133): db_query('INSERT
    INTO `os...', true, true)<br />

    #2 (root)/include/class.orm.php(597):
    MySqlExecutor->execute()<br />

    #3 (root)/include/class.attachment.php(161):
    VerySimpleModel->save()<br />

    #4 (root)/include/ajax.draft.php(101):
    GenericAttachments->upload(Array)<br />

    #5 (root)/include/ajax.draft.php(300):
    DraftAjaxAPI->_uploadInlineImage(Object(Draft))<br />

    #6 [internal function]:
    DraftAjaxAPI->uploadInlineImage('18719')<br />

    #7 (root)/include/class.dispatcher.php(145):
    call_user_func_array(Array, Array)<br />

    #8 (root)/include/class.dispatcher.php(38):
    UrlMatcher->dispatch('18719/attach', Array)<br />

    #9 (root)/include/class.dispatcher.php(120):
    Dispatcher->resolve('18719/attach', Array)<br />

    #10 (root)/include/class.dispatcher.php(38):
    UrlMatcher->dispatch('/draft/18719/at...', NULL)<br />

    #11 (root)/scp/ajax.php(262):
    Dispatcher->resolve('/draft/18719/at...')<br />

    #12 {main}

  • Got same problem here!
    When I try to paste an image into any answer nothing happens.
    If I try to insert the same image into an internal note, paste works.
    I'm also reciving several DB error via mail
  • This sounds like an issue with the WYSIWYG editor [Redactor] and not osTicket.
    Work around is to save the image and click the insert button... which I find works every time.
  • I guess the same thing but copy and paste was a huge benefit of the WYSIWYG edito
    Does anyone had the same problem?
  • I've never had consistent luck with copy and paste working in the editor.
  • Which version are you talking about?
    1.9.x copy and paste was perfect
    1.10 really bad copy and paste
  • I am talking about the following versions:
    1.6ST, 1.7-dpr, 1.7dpr2, 1.7-RC1, 1.7-RC2, 1.7-RC3, 1.7-RC4, 1.7-RC5, 1.7-RC6, 1.7.0, 1.7.1RC1, 1.7.1, 1.7.1.1, 1.7.1.2, 1.7.1.3, 1.7.1.4, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.7.12, 1.7.13, 1.7.14, 1.8-dpr, 1.8.0-rc1, 1.8.0-rc2, 1.8.0, 1.8.0.1, 1.8.0.2, 1.8.1-dpr, 1.8.1-rc1, 1.8.0.3, 1.8.1, 1.8.1.1, 1.8.1.2, 1.8.0.4, 1.8.2-dpr, 1.9-rc, 1.8.3, 1.9.0, 1.9.1, 1.8.4, 1.9.2, 1.8.5, 1.9.3, 1.9.4-dpr, 1.9.4-rc1, 1.9.4-rc2, 1.9.4-rc3, 1.9.4-rc4, 1.9.4-rc5, 1.8.6, 1.9.4, 1.8.7, 1.9.5, 1.9.5.1, 1.8.8, 1.9.6, 1.8.9, 1.9.7, 1.8.10, 1.9.8, 1.10-dpr, 1.9.8.1, 1.8.11, 1.9.9, 1.9.11, 1.8.12, 1.10-rc1, 1.10-rc2, 1.9.12, 1.9.13, 1.9.14, 1.10-rc3, 1.9.15, 1.10

    in short all of them.
  • Is there any method to troubleshoot copy and paste?
  • osTicket does not author the WYSIWYG editor.  So you can troubleshoot it all you want, but it appears to be Redactor having the issue so all the devs can do is forward the reports upstream.
  • osTicket used different Redactor version from 1.9.15 to 1.10?
  • But excel text is not and image? :-P 
  • wait... what?  
    (scrolls back up)
  • Ah I see.
    I thought that we were discussing the snipping tool to make images and copy and paste them (I use the snipping tool quite often - read daily)

    Copying and pasting from excel would be XML or plain text or rtf right?  It wouldn't be an attachment.
  • I've noticed that images copy and paste is still not well working on client side (NOT scp)
  • Same here, till the upgrade to 1.10, pasting images worked like a charm, now getting bunch of "Duplicate Entry".

    It seams it doesn't like when you paste in new line, especially after hitting "Enter" and then posting. Going back to last line (after the last entered character) and pasting there seams to work.
  • Are you experiencing the same problem also when you paste something on internal notes?
  • edited November 2016
    It's very interesting when you talk about hitting "Enter" because I'm having the same problem!
    Sometimes on internal notes I'm not experiencing the same problem.
  • Same goes for internal notes, see attached file.
    ost.jpg
    550 x 152 - 9K

  • ost.jpg
    550 x 152 - 9K
  • @ntozier: did you recived any update from redactor's developers?
  • @planetcaravan 
    Why would I hear anything from the developers of another product that I'm not related with at all?
  • Maybe I did not understand. I red your post on GitHub. Can we speak directly with redactor's developers?
  • I have no idea. I have nothing to do with Redactor.  I just happen to know that its the WYSIWYG editor used in osTicket.
  • What do you think if we can try to replace the new code on 1.10
    <script type="text/javascript" src="/js/redactor.min.js?901e5ea"></script>
    <script type="text/javascript" src="/js/redactor-osticket.js?901e5ea"></script>
    <script type="text/javascript" src="/js/redactor-plugins.js?901e5ea"></script>


    With the 1.9.15's code?
  • You can feel free to try whatever you want. :)
    I am not a dev, so I have no idea if it will work, help, or hinder.
  • edited December 2016
    Please do not look at this post, look at the second page
    Screenshot - 05_12_2016 , 16_15_51.png
    949 x 599 - 13K
Sign In or Register to comment.