Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.10 - Image PASTE not working - from filesystem #3481

Closed
mlipok opened this issue Nov 8, 2016 · 81 comments · May be fixed by #4109
Closed

v1.10 - Image PASTE not working - from filesystem #3481

mlipok opened this issue Nov 8, 2016 · 81 comments · May be fixed by #4109
Assignees

Comments

@mlipok
Copy link

mlipok commented Nov 8, 2016

I took a screenshot from an app and I wanted to paste the screenshot to the ticket.
There is a small "progress bar" rather than a spinning wheel - which means data is being uploaded....
but the image does not appear on the edited ticket's content :(

@ntozier
Copy link
Contributor

ntozier commented Nov 8, 2016

This is a redactor feature and should be addressed upstream with them (@JediKev @protich). In the meanwhile if you simply click the insert image icon and drag and drop the image you should have better luck.

@mlipok
Copy link
Author

mlipok commented Nov 8, 2016

Thanks for answer
I will try your solution soon.

@mlipok
Copy link
Author

mlipok commented Nov 21, 2016

Of course it works but I hope this will be fixed soon, as COPY PASTE images was one of the best feature in this HTML Editor.

@mlipok
Copy link
Author

mlipok commented Nov 21, 2016

I notice that I get this kind of error:


[INSERT INTO `ost_attachment` SET `file_id` = 6093, `type` = 'D', `object_id` = 15488, `name` = 'screenshot-NG9O']

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


But now this PASTE Image appears in editor.

@vieckzand
Copy link

I have the same error when copy paste image from clipboard (DB Error #1062). Can anyone solve for this?
Thank you

@sjaakverhoog
Copy link

Me to:
DB Error #1062 [INSERT INTOost_attachmentSETfile_id= 112,type= 'D',object_id= 184,name` = 'screenshot-FfHO'] Duplicate entry '184-112-D' for key 'file-type'

---- Backtrace ----
#0 (root)/include/mysqli.php(204): osTicket->logDBError('DB Error #1062', '[INSERT INTO o...') #1 (root)/include/class.orm.php(3133): db_query('INSERT INTO os...', true, true)
#2 (root)/include/class.orm.php(597): MySqlExecutor->execute()
#3 (root)/include/class.attachment.php(161): VerySimpleModel->save()
#4 (root)/include/ajax.draft.php(101): GenericAttachments->upload(Array)
#5 (root)/include/ajax.draft.php(300): DraftAjaxAPI->_uploadInlineImage(Object(Draft))
#6 (root)/include/class.dispatcher.php(145): DraftAjaxAPI->uploadInlineImage('184')
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('184/attach', Array)
#8 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('184/attach', Array)
#9 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/draft/184/atta...', NULL)
#10 (root)/scp/ajax.php(262): Dispatcher->resolve('/draft/184/atta...')
#11 {main}`

@JediKev
Copy link
Contributor

JediKev commented Dec 8, 2016

Could you please describe your environment and osTicket version as I can not reproduce this issue.

@sjaakverhoog
Copy link

screenshot_2016-12-08-18-20-39

@JediKev
Copy link
Contributor

JediKev commented Dec 8, 2016

Are you trying to copy and paste on that tablet/phone or on a computer?

@sjaakverhoog
Copy link

No on a PC.. But i wasn't close tot my PC when your asked for more info. I want tot paste a received email from outlook with images inside the text. When i paste everything i see dubble "enter" lines and no images.

@JediKev
Copy link
Contributor

JediKev commented Dec 8, 2016

Ok, firstly I'm running CentOS 7 with Apache and osTicket v1.10(latest) and I'm able to paste images all day long with no errors. You need to explain your environment in more detail so we can further try to replicate that issue.
Secondly, we do not support pasting from a Word Document and keeping its format and attachments.

@ntozier
Copy link
Contributor

ntozier commented Dec 9, 2016

@thinkfuture
Copy link

Is there an update on this issue? Find it hard to believe that such a key element is lacking in the editor for a support application. Please advise.

@FossPrime FossPrime changed the title v1.10 - Image PASTE not working v1.10 - Image PASTE not working - from filesystem Feb 8, 2017
@jane-t
Copy link

jane-t commented Mar 30, 2017

I am also getting this error. I am trying to paste images from the clipboard (screen grabs) they do not exist as files on my Windows PC, I just grab them with a screen grabber, copy the image to the clipboard and try and paste into the Editor (this worked fine with 1.8 which we were running previously to updating to 1.10)

@mlipok
Copy link
Author

mlipok commented Apr 7, 2017

Try to paste them several times.
This should works sometimes, at least it works in this way for my case.
Could you confirm that this works in this way ?

@jane-t
Copy link

jane-t commented Apr 9, 2017

Thanks pasting twice does work.

@2ge
Copy link

2ge commented May 5, 2017

I got same problem with v1.10-47-gb9f0937 (b9f0937), is there some fix ? - I have English pack installed only (default)

[INSERT INTO `ost_attachment` SET `file_id` = 331, `type` = 'D', `object_id` = 142, `name` = 'screenshot-lgbA']

Duplicate entry '142-331-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('142')<br />
#7 (root)/include/class.dispatcher.php(145): call_user_func_array(Array, Array)<br />
#8 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('142/attach', Array)<br />
#9 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('142/attach', Array)<br />
#10 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/draft/142/atta...', NULL)<br />
#11 (root)/scp/ajax.php(262): Dispatcher->resolve('/draft/142/atta...')<br />
#12 {main}

@kest874
Copy link
Contributor

kest874 commented May 5, 2017

Have noticed, if you past first then add your text it works every time.

@pespi123
Copy link

It also works, if you past on the same line as the text you previously wrote. The editor automatically adds a break before the image (tested in Chrome and Firefox).

This doesn't work, if you already tried to spam the image into the editor before...

@mlipok
Copy link
Author

mlipok commented May 11, 2017

Big thanks this is just:
Eureka !!

@balojs
Copy link

balojs commented May 11, 2017

Same problem

@mlipok
Copy link
Author

mlipok commented May 11, 2017

@balojs could you also confirm that @pespi123 solution works for you ?

@eptiliom
Copy link

eptiliom commented May 17, 2017

@mlipok The above solution does not work for me.

I get the following error message as soon as I try to paste.

image

EDIT:
This particular error was caused by inadequate permissions on the php upload_tmp_dir. I changed it to C:\temp in php.ini and then gave my apppool permissions to read and write to it. Now I am getting the same error as above.

@davidegiunchidiennea
Copy link

@JediKev your patch #4113 does fix the problem, thank you

@mlipok
Copy link
Author

mlipok commented Feb 21, 2018

@davidegiunchidiennea as you can read from last @JediKev response the DevTeam has taken a decision to change editor at all (as far as I understand @JediKev statement).
So be patient in waiting for new version.

@Aka4Code
Copy link

@JediKev What's the status of this issue? Do you have any roadmap when you plan to release these changes in text editor?

@JediKev
Copy link
Contributor

JediKev commented Oct 25, 2018

@Aka4Code

We never have/promise timelines for anything as we are always working on 1,000 things at a time, but it's coming. New/replacement text editor will be added in/after version 2.0. No set release date or development date for this version as we are still trying to release 1.11.x. Please stay tuned.

Cheers.

@Aka4Code
Copy link

Aka4Code commented Oct 26, 2018

@JediKev I'm sorry, I misunderstood your previous message:

I can't reveal these plans just yet but know changes are coming soon for the text editor.

  • This was back in January, ten months ago...

I suppose if 1.11 is not yet ready, then version 2.0 and these changes in text editor will not come soon, at least not in next 2-3 years i predict :/ We have different understanding of coming soon statement I'm afraid.

Thank you for detailing, and that you prove me wrong, so I know whats real status of this issue.

Cheers.

@JediKev
Copy link
Contributor

JediKev commented Oct 26, 2018

@Aka4Code

Well we do not have set release or development dates so all I can ever say is soon so...yea.

Cheers.

@osTicketRocks
Copy link

I also do have the issues with copy+pasting a screenshot into the WYSIWYG editor.
However, I only experience the problem in Firefox (latest update but earlier versions as well).
In Internet Explorer or Chrome I don't have any problems.

I already tried updating scp.js & redactor.min.js with the informations provided by JediKev - but sadly I didn't help.
Is there any mandatory information about this issue regarding Firefox?
(The customer that uses osTicket is not able to install other browser so only FF or IE able).

Thank you very much!

@Aka4Code
Copy link

Aka4Code commented Dec 5, 2018

@osTicketRocks this issue also exists in Chrome

@Aka4Code
Copy link

@JediKev please remember about this bug, maybe next release it will be possible? 1.11 is great work!

@mlipok
Copy link
Author

mlipok commented Feb 22, 2019

btw.
I found that when I paste specyfic screenshot to ThunderBird email, and then copy them from ThunderBird then I have always no problem with pasting to osTicket.

@JediKev
Copy link
Contributor

JediKev commented Feb 22, 2019

@Aka4Code

I still cannot reproduce this error. I tried with Mac, Linux, and Windows (v1.10.4-5 and v1.11) and I'm able to paste every time I did notice that you cannot paste a screenshot from a localhost site as it's not a publicly accessible image nor an image from the computer itself.

Cheers.

@CashDesk
Copy link

We are using windows and Chrome browser. We have it inhere always. Never works. Myabe this info helps?

@Aka4Code
Copy link

Our osTicket is not localhost - it's in publicly accessible hosting.

Image is pasted from clipboard - for example copied by Windows Snipping Tool
or from some graphic editor like Windows Paint.Net.

@Aka4Code
Copy link

Tested with Chrome and Windows 10 1809.
Same behavior with 1.10 and 1.11.

@JediKev
Copy link
Contributor

JediKev commented Feb 22, 2019

@CashDesk

Unfortunately that does not help as I tested using the same and I'm able to paste.

@Aka4Code

I just tested using Windows Server 2016, Chrome (latest), and Snipping Tool and it works just fine:
screen shot 2019-02-22 at 09 45 05

Cheers.

@Aka4Code
Copy link

image

This config helps anything? Can I deliver to you some other logs?

@JediKev
Copy link
Contributor

JediKev commented Feb 22, 2019

@Aka4Code

Thank you for that but it doesn't really help as I tested using osTicket hosted with NGINX, osTicket hosted with Apache, and osTicket hosted with IIS all let me paste images from Snipping Tool just fine. I'm not sure where the issue lies for you guys as it's working for me and the "errors" you guys post are not detailed errors, rather, error codes.

The only thing that will be helpful at this point is detailed error logs and an example image.

Cheers.

@Aka4Code
Copy link

How can I help? From what source you want this logs? Image I can deliver. Logs also, but I need to know from where you want me to get them. Apache logs/php logs/mysql logs/osticket logs or something different?

@JediKev
Copy link
Contributor

JediKev commented Feb 22, 2019

@Aka4Code

Any errors that are related. Just make sure they have details and not just an error code.

Cheers.

@thctlo
Copy link

thctlo commented May 8, 2019

still errors in 0.12 ( but it works if you past 2x )

@ebonweaver
Copy link

Happens if you reply to a ticket email. Brand new install/setup. Actually don't think it's the same issue but a ticket with this issue was closed as a duplicate so...

[INSERT INTO ost_attachment SET type = 'H', object_id = 11, file_id = 1, inline = 1]

Duplicate entry '1-11' for key 'file_object'



---- Backtrace ----

#0 (root)/include/mysqli.php(199): osTicket->logDBError('DB Error #1062', '[INSERT INTO o...')<br /> #1 (root)/include/class.orm.php(3455): db_query('INSERT INTO os...', true, true)

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

#3 (root)/include/class.thread.php(1189): VerySimpleModel->save()

#4 (root)/include/class.thread.php(1197): ThreadEntry->createAttachment(Array, 'powered-by-osti...')

#5 (root)/include/class.thread.php(1665): ThreadEntry->createAttachments(Array)

#6 (root)/include/class.thread.php(1677): ThreadEntry::create(Array)

#7 (root)/include/class.thread.php(2748): ThreadEntry::add(Array)

#8 (root)/include/class.thread.php(2963): MessageThreadEntry::add(Array, Array)

#9 (root)/include/class.ticket.php(2692): ObjectThread->addMessage(Array, Array)

#10 (root)/include/class.ticket.php(3099): Ticket->postMessage(Array, 'Email')

#11 (root)/include/class.thread.php(571): Ticket->postThreadEntry('M', Array)

#12 (root)/include/class.thread.php(839): Thread->postEmail(Array, Object(ThreadEntry))

#13 (root)/include/class.mailfetch.php(845): ThreadEntry->postEmail(Array)

#14 (root)/include/class.mailfetch.php(917): MailFetcher->createTicket(1)

#15 (root)/include/class.mailfetch.php(997): MailFetcher->fetchEmails()

#16 (root)/include/class.cron.php(25): MailFetcher::run()

#17 (root)/include/class.cron.php(110): Cron::MailFetcher()

#18 (root)/include/api.cron.php(19): Cron::run()

#19 (root)/include/api.cron.php(40): CronApiController->run()

#20 (root)/api/cron.php(23): LocalCronApiController::call()

#21 {main}

@sjxiong
Copy link

sjxiong commented Sep 30, 2019

I have the same problem, when I tried to paste a picture in email reply, I got this error:
image

@JediKev
Copy link
Contributor

JediKev commented Sep 30, 2019

@mlipok @vieckzand @Aka4Code @davidegiunchidiennea @osTicketRocks @CashDesk @thctlo @ebonweaver @sjxiong

The new/improved editor is released with v1.14-rc1 available here:

It is an RC so we do not recommend running in production. You may install a new instance to test copy/paste with the new editor. If you find any issues, please do a recursive search in this repo first to see if there is an issue created for it already and if not create you’re own issue report. Make sure to fill out the entire Issue Template for the best possible assistance.

Cheers.

@mlipok
Copy link
Author

mlipok commented Mar 26, 2020

For now I can confirm that this problem is not occuring any more from time when we install v1.14.x
I think if any other user (@vieckzand @Aka4Code @davidegiunchidiennea @osTicketRocks @CashDesk @thctlo @ebonweaver @sjxiong) confirm that this is fixed .... then this ticket can be closed.

@dbummy
Copy link

dbummy commented Mar 26, 2020

When I upgraded to 1.14, it fixed this issue for me.

@CashDesk
Copy link

Upgrading to 1.14 solved the problem!

@mlipok mlipok closed this as completed Mar 29, 2020
@thctlo
Copy link

thctlo commented Mar 30, 2020

Running 14.1 now and yes.. solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.