Elxis CMS Forum

Support => Administration => Topic started by: Eleanna on March 23, 2017, 13:18:17

Title: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 23, 2017, 13:18:17
Hello everybody!
We are building a multilingual site in ELXIS 4.5.
When we copy  html code from an object(article,category) of the old site and try to paste it to the source code of the new one as a translation,ckeditor freezes and we are not able to save the translation nor the whole article except from "cancel"(ακύρωση) in ELXIS Admin page.
Note that this problem occurs only for the translation language and not the default language.

We also noticed that it does not occur on PCs running Win 7, but it does happen on PCs running Win 8.1 and above.

The problem also occurs in both firefox and Chrome and Firefox is up to date!

Has anyone faced a similar problem ?

Any ideas-suggestions are mostly welcome.

Thank you in advance
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: nikos on March 23, 2017, 15:24:28
If  the old site is an Elxis 200X.x version, instead to make copy paste article by article to the new one version 4.5 is much better to try the Elxis Converter (https://www.elxis.net/edc/miscellaneous/57.html) tool for which information how to use it and what it converts, you can see here (https://forum.elxis.org/index.php?topic=7914.0).
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 23, 2017, 15:40:31
Thanks a lot Nikos, we've already successfully run elxis converter for the greek content!! As we mention above, the problem (freezing) occurs only on source code for the translations and not the content of the default language.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: datahell on March 23, 2017, 18:29:45
I think it is a matter of RAM, not operating system or browser (although some browsers make better use of memory than others). Close whatever you dont use and browser tabs you dont needs and re-try. When you copy formatted HTML text the editor runs special plugin to handle this action which is CPU consuming. If you cant find a solution turn both editors in HTML mode and copy-paste source html code.

Note: Elxis Converter SUPPORTS conversion of multilingual items. See Nikos help link.

Taken from Elxis Converter instructions: "Multilingual content items, autonomous pages and menu items are converted to Elxis 4.x translation items."
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 23, 2017, 19:06:05
Thanks Datahell, we have tried closing every tab and keeping only the 2 necessary (admin page of the two sites), but with no result. The funny thing is that my pc, which runs win7 with 2 gb RAM has no prob, whereas another pc, running win10 with 4gb RAM has the problem! We tried in win8.1, again we had problem. We tried 2 other pcs with win10, problem. We tried another pc (not mine) running win7, no problem!!! It's funny, isn't it? I think that someone is laughing at us!!

By the way, we read your article before running the converter (to be exact, I had it printed - when I generally do not print), so that I am absolutely confident that I understand what I'm about to do and I had read the relevant topics and various problems others faced before attempting anything, so that I don't do the same mistakes. So I marked what had meaning for us and I quote:
"This option has effect only on sites with content in multiple languages.

If you select Yes, content for all languages will be mixed to the final output. For instance if you have in mainmenu a menu item named "Home" in English and an other menu item named "Αρχική" in Greek in the final result both "Home" and "Αρχική" will be shown for English and for Greek! The same will happen for categories, articles, etc. If you have content in more than 2 languages the mess will become even bigger. Choose this option only if you absolutely understand what it means and you want to do something custom.

Instead of selecting Yes, if you select No, then only content for the main, or all, language will be converted and at a later step you will be able to convert the rest content as translations of the content in the default language.

I cant analyze it more, it is a long discussion that derives from the different multilinguism philosophy of Elxis 200x.x and Elxis 4.x, but I think you got the idea."

Our multilingual content falls into that category... There is no connection between articles and translations. They are completely different articles belonging to completely different categories, published in 3 different languages.

Of course, that option was considered in the beginning and just to give you an idea of our frustration, even if you have your article in greek, english, french and for some reason you want to copy sth from the greek source code to the english and french, the greek source code button works, but for the english and the french it freezes!!! That means, that even if the converter did work and somehow managed to link our articles from 3 different languages to one article with 3 translations, we still couldn't copy paste from source code to source code. And in case anyone is wondering about the steps taken, we open the description tab, click source, ctrl+C a phrase, click the source, select english, click source, select phrase, ctrl+V, click source and....freeze!
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: nikos on March 23, 2017, 20:10:55
Eleanna try to do it again on a last version Firefox (currently 52.0.1) without Add-ons and I suggest you on Windows 7 PC, which works without problem as you say, to upgrade RAM from 2 GB to 4 GB.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 23, 2017, 20:57:55
We do realize that we can not rollback win10 to win7, right?! Of course I don't intend to change my pc, which is working fine! The problem is my colleagues' pcs which are win 8.1 and win10 respectively!!! They have the problem (along with any other win10 pc we tried) and we have already checked if the firefox is up to date (btw no browser issue because we tried chrome and edge also), if there are any issues with the javascript (but ckeditor in general does work), gmelis (you know Gerasimos..!) suggested update the vga driver, we tried that also, no luck!! If it was not working on my pc, I swear, I would ask gmelis to help and to double check the apache or sth. But it does work on win7 (both mine and another pc)! This is the only difference in our pcs. I thought of the antivirus also, again, we have the same antivirus! No difference, but the OS. It really bugs me!!!
The last thing I could think of, is whether the ckeditor could take an update. What if there is an issue with win10, which is fixed with a later version of ckeditor? Could we update the version of ckeditor and if yes, how? As I checked, the version of our ckeditor in elxis 4.5 is 4.5.6 (I checked in the morning, I'm not so sure that I remember correctly) and now is 4.6.2?
Datahell, do you think that that could worth a try? Or is it irrelevant?
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: datahell on March 23, 2017, 21:42:50
Ooops, we have a XY problem (https://forum.elxis.org/index.php?topic=8843) ;D

I believe you are looking to the wrong direction. The operating system is not the problem. You copy-paste formatted text which is, from the begging, a bad idea. It is like those copying text from MS Word and paste it in Elxis (BTW there is a special editor plugin for that). My advise is to copy the html source code (turn editor in html mode). If you do it you will have 0 problems.

Tip: You can perform some testing. Copy - paste a few words. Does the editor freezes? If not, copy paste more. Then copy-paste a whole paragraph. Continue like this to find out when the editor freezes. If you find the spot check original texts html in that spot to see what it is there that makes ckeditor freezing (it could be even a non accessible source item, media items, javascript, invalid code,etc).
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 23, 2017, 21:57:31
Datahell if only that was the problem!!!!!!!!
We do NOT copy paste formatted text. We copy paste ONLY html, from html code (Elxis 2009.3) to source code (Elxis 4.5). We NEVER, EVER, EVER copy text from word. It is an ABSOLUTE rule, no exceptions, even if the editor provides the button.
We have already tried the size! No matter if the phrase that we copy (with ctrl+C and ctrl+V, NO right click) is small (e.g. /media/images/categories in the src of an image) or big (a full text with paragraphs), as soon as you leave the source mode to return to WYSIWYG, the ckeditor freezes. At that exact moment. And only for the translation! NOT the default language. The source freezes when you exit source mode, NOT when you enter. And that happens on win 8.1 and win10, but not win7!!!
I already checked the forums for ckeditor, there was an issue at the exact point that I mention, but they said it is fixed since version 4.5.2.
Now, given the fact that it does not happen for the default language, the source toggle there is working fine, but the problem occurs only in the translation, what could it be?
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 23, 2017, 22:07:03
By the way, I loved your post for the XY problem, actually I ran into it this morning, I printed it (!!! despite the fact that I rarely print) and posted it next to my desk!!! I've loved it!!
But here, that is not the case! I specifically described the actual problem (freezing) and the steps I took. I never even said that I pasted formatted text!! And I never asked for a different solution from the problem!!
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: rentasite on March 24, 2017, 22:49:49
We do NOT copy paste formatted text. We copy paste ONLY html, from html code (Elxis 2009.3) to source code (Elxis 4.5).

HTML is formatted text also
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 25, 2017, 09:57:42
Thanks for your reply rentasite... Very helpful to the problem... Datahell suggested "My advise is to copy the html source code (turn editor in html mode). If you do it you will have 0 problems." This is what we've done from the very beginning. No more comments on that...

And this is the problem:
"as soon as you leave the source mode to return to WYSIWYG, the ckeditor freezes. At that exact moment. And only for the translation! NOT the default language. The source freezes when you exit source mode, NOT when you enter. And that happens on win 8.1 and win10, but not win7!!!
I already checked the forums for ckeditor, there was an issue at the exact point that I mention, but they said it is fixed since version 4.5.2."
Please, please,  any suggestion to THAT?

P.S. link to ckeditor http://ckeditor.com/blog/CKEditor-4.5.2-Released , at the second paragraph, under browser specific you can find this: "Among the fixed issues were various “permission denied” errors or browser crashes when switching from source mode to WYSIWYG. The latter issue was actually debugged and fixed by Andrew Williams and Mark Smeed "
So, the problem did exist, they faced it (it's not in my imagination...).
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: nikos on March 25, 2017, 15:16:43
... And that happens on win 8.1 and win10, but not win7!!!...

So use only Windows 7 and continue your work without to care about the rest windows versions.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 25, 2017, 18:32:00
Dear Nikos, I'm speechless... I really am.

Before posting to the forum, I tried everything you suggested, so that to be sure that I did what I could from my behalf. I did this because I respect your time and your efforts and because I think that nobody is obliged to help me. I set the problem, I described the steps I took and I presented the results of my search. If you think that I might be looking the wrong direction, you can point the right one. Since you do not point to any direction, I will continue trying to find the solution by myself.

Thank you all very much for your time anyway.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 27, 2017, 13:39:24
Hello everybody,

The problem was identified by entering debug code in ckeditor.js

During language switching, the editor object becomes detached from "this", whatever this may be (see Screenshot)

this.editor (a = this.editor) is assigned to the variable "a" and somewhere the control is lost and this results in uncatchable "a is not defined".

Although the this.editor is missing, the status = "detached" (green arrow) remains.

This can be fixed with a page refresh, as obviously something is left in memory.

Suggestion: Should there be a reassigning of the object editor to "this" during the language switching?

For the record, the CKEDITOR object remains active in the DOM.

Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: datahell on March 27, 2017, 23:00:54
I have to test it to answer you but I believe this is not the answer to your problem. The editor freezes because of what you copy-paste. Copy-paste plain text and I am sure the editor will not freeze. If the undefined "a" was the problem the editor would have the same problem even if you pasted a single character. BTW if I remember correctly "a" is from jQuery, not from the editor. If you pay attention to the source code of what you copy-paste you might get a clue why it freezes. The editor tries to represent whatever you paste to it. If you paste inaccessible data, blocked data, data with wrong html, etc, most probably you will create a problem similar to the one you have. It is like windows freeze some times when you try to open a, for example, inaccessible network drive.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 28, 2017, 20:59:30
Quote
We have already tried the size! No matter if the phrase that we copy (with ctrl+C and ctrl+V, NO right click) is small (e.g. /media/images/categories in the src of an image) or big (a full text with paragraphs), as soon as you leave the source mode to return to WYSIWYG, the ckeditor freezes. At that exact moment. And only for the translation! NOT the default language. The source freezes when you exit source mode, NOT when you enter.

As I said before, no matter what we paste, it freezes. Let's say we have a new location of an image and we want to update it for the greek, english and french article. We copy the correct image path from the greek and we want to paste to the translations. It freezes. We tried a dummy <p>This a paragraph</p>. The same. It has nothing to do with what it's pasted. The is the only thing I'm certain. And I said it from the beginning. Since you don't believe me, ask Nikos and Gerasimos. They both witnessed that.

We tried several staff since Thursday. Opera seems to have no problem, also Debian (with either Firefox or Chrome) have no problem. I have win 10 at home and tried new elxis at localhost. Now here, the problem occured only once, at the beginning, then it's ok. I have no problem.
I cannot figure that out any more... :-\
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: datahell on March 28, 2017, 21:20:37
I told you what you should look. I can't reproduce the problem. For me copy-paste works perfect even if I copy-paste text with images and CSS from the internet. Also I get 0 javascript errors in console window. My PC is old (windows vista) and it has not much ram but the copy-paste is super fast. The only thing I can do more for you is to connect to your pc with team viewer to see it. I have no other solution for you.

Note: If you connect to the internet via a proxy then this might be the problem (or an antivirus/firewall). I told you that similar problems are caused mostly by inaccessible data.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 28, 2017, 22:42:30
I think I understand what you thought! You think that the editor freezes when we paste sth. No... The editor freezes when you exit the source mode after you have pasted an html code for the translation only. When you hit the button source code to return to wysiwyg.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: datahell on March 28, 2017, 23:18:39
It is the same thing and makes stronger my belief that the editor freezes on rendering time (when you paste under standard mode, or you switch from html to standard mode) because it cannot render the content you paste. And this is not editors' problem! Other things blocks the editor from working. For me the cause of your problem is very clear. Case closed.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: webgift on March 29, 2017, 10:49:33
+1 to @datahell's thought. It's absolutely clear! Paste to a txt file what content try to be
rendered and send it back to us!
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 29, 2017, 11:37:58
Since it so crystal clear to you that the problem is the html, explain to me why it does not happen to greek editor (which is the default language and there it is rendered fine), but it does happen to english and french.
I understand that it is a very "peculiar" issue, but, please, do not treat me like ....
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: webgift on March 29, 2017, 11:48:38
@Eleanna,
Paste what you are trying to render from source code to wysiwyg in a txt file and attach it
for further investigation. Let's stop writing-talking with hypotheses.

I don't treat you like ... however i believe that we have spent so many hours to so obvious
issue.

PS: Greek language don't use latin characters.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 29, 2017, 12:05:02
Webgift I have already given you an example. It is the "/media/images/category/image.png". We replaced an image from the old site to a new location and we want to update the path to that image. So copy paste the url. Another example: We create a new article. We write whatever dummy in greek. We save. We go to translation and copy paste the "<p>This is a paragraph</p>" to source code. We do not try anything special. It is not sth specific that we paste.
I agree that we have already lost so many hours. I'm tired. And I don't want it to continue anymore...  :-\
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: webgift on March 29, 2017, 12:14:57
I have followed the actions you've described and i can't find any issue. Can you give access
to your installation?
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 29, 2017, 12:31:05
Unfortunately, I cannot give you access...
The only possible action is the team viewer Datahell suggested and he knows why this is the last and only action.
If you think that you want to get involved, tell me to send you pm with contact details.
Thank you for your time.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: webgift on March 29, 2017, 12:56:06
I don't use remote desktop sharing tools. Sorry.
Title: Re: ckeditor crashes(freezes) when copy-paste html code in source mode
Post by: Eleanna on March 29, 2017, 13:16:01
I respect that. Thank you again for your time.