• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed XF 1.5.5 Firefox Paste Bug

markku

Well-known member
#1
After upgrading to XF 1.5.5, Firefox (43.0.4) on Mac seems to be behaving oddly at random times when pasting content.

Just a few moments ago I tried pasting copied text into between chunks of text, and the pasted text completely disappeared from the WYSIWYG editor, but was viewable and available in the BB Code Editor.
 

StarArmy

Active member
#2
It seems like since the last forum upgrade to 1.5.5, I can't paste images into a thread and sometimes when I paste text it's hidden until I go into the bbcode view and back. It sounds like the same problem as the above user. I am also using Firefox 43.0.4 (the newest version) but I am on Windows 7 and/or Windows 10.

Edit: One of my forum users also says it's also happening on Chrome.
 
Last edited:

Chris D

XenForo developer
Staff member
#3
We did make some minor changes to pasting in the editor in XF 1.5.5 but they should only target the Edge browser.

Is there any particular behaviour, text or image that reprocuces this reliably, or more often?

Currently can't reproduce on Firefox 43.0.4 on either Windows or Mac OS X.
 

StarArmy

Active member
#4
When I paste the image into the thread, it shows up in my point of view, but when I actually post it, the image does not appear in the reply.

On my forum, the image paste bug works on the Default XenForo style so it's not likely to be a style issue.
 

markku

Well-known member
#7
Can you guys reproduce the problem here?
I can't reproduce here. But I can for 100% certainty say it never happened before XF 1.5.5.

Could it be a clash with some add-on, only starting after upgrading to XF 1.5.5?

I guess I have no choice but to disable all add-ons and try again... It's a monumental job to enable them one by one and try to find the culprit, but it is what it is...
 

Aivaras

Active member
#9
I can confirm there is a problem when pasting text in the rich text editor. I noticed it in Firefox after 1.5.5 update. I cannot reproduce it here though. But I can reproduce it with 100% consistency on both my public and test forums (in the latter case with all the add-ons disabled and the default style on).

1. If I type a text in the rich text editor and paste it using Ctrl+V I get a blank.

2. If I use Ctrl+Shift+V the text is pasted.

3. If I do step 1 and switch to the BB code editor I can see the pasted text there. If I then return to the rich text editor the pasted text becomes visible there, too.

4. If I paste a text from an external text editor all seems to be fine.
 

Chris D

XenForo developer
Staff member
#10
But I can reproduce it with 100% consistency on both my public and test forums (in the latter case with all the add-ons disabled and the default style on).
To clarify, how have you disabled all add-ons? Did you do it one by one in the Admin CP or some other way?

To everyone else who can reproduce this, please follow the following instructions:

1. Enable debug mode by adding the following to config.php:
PHP:
$config['debug'] = true;
2. Go to Options > Debug Options
3. Set the "Use Uncompressed JavaScript" option to "Use uncompressed files from js/xenforo/full/" and Save
4. Reproduce the issue
5. Check inside your browser's console (F12 Developer Tools > Console), are there any errors or other info?
6. Change the option set in 3. back to "Use compressed files from js/xenforo/"
7. Remove the line added to config.php in step 1.

Any more info appreciated!
 

erich37

Well-known member
#11
happened to me as well.

- when I paste the text into the "Editor", then the pasted text is not visible.
- when I click the "save"-button (e.g. in Private Conversation), then the pasted text suddenly appears in the message.

Firefox (43.0.4)
 

Aivaras

Active member
#13
2. Go to Options > Debug Options
3. Set the "Use Uncompressed JavaScript" option to "Use uncompressed files from js/xenforo/full/" and Save
4. Reproduce the issue
5. Check inside your browser's console (F12 Developer Tools > Console), are there any errors or other info?
6. Change the option set in 3. back to "Use compressed files from js/xenforo/"
7. Remove the line added to config.php in step 1.

Any more info appreciated!
I get "TypeError: match is null."

The browser points to: ..."js/redactor/redactor.full.js?_v=3c638f56".

and

Code:
if (this.browser('msie') || this.isMobile(true) || match[1] == 'edge')
 
Last edited:

Chris D

XenForo developer
Staff member
#14
I had a suspicion this would be the code responsible, be that it's the only code that changed. Just annoying it wasn't immediately reproducible.

Thanks all.

The fix is fairly simple. Revert any changes you made as a result of my previous post.

Then open js/redactor/redactor.js and find:
Code:
exec(c)
(It should only occur once)

And replace with:
Code:
exec(c)||[]
 

markku

Well-known member
#15
I had a suspicion this would be the code responsible, be that it's the only code that changed. Just annoying it wasn't immediately reproducible.

Thanks all.

The fix is fairly simple. Revert any changes you made as a result of my previous post.

Then open js/redactor/redactor.js and find:
Code:
exec(c)
(It should only occur once)

And replace with:
Code:
exec(c)||[]
This seems to have fixed it for me. Thank you.
 

Mike

XenForo developer
Staff member
#16
This has been fixed now and as of this post, the 1.5.5 package has been updated to indicate this. The download will now be referred to as 1.5.5a to indicate it includes this patch.

If you are already running 1.5.5, to fix this you may overwrite these two files from the 1.5.5a zip:
  • js/redactor/redactor.full.js
  • js/redactor/redactor.js
Alternatively, to fix it manually, in js/redactor/redactor.full.js, find:
Code:
match = /(edge)[ \/]([\w.]+)/.exec(ua);
And replace it with:
Code:
match = /(edge)[ \/]([\w.]+)/.exec(ua) || [];
In js/redactor/redactor.js, find:
Code:
exec(c)
And replace it with:
Code:
exec(c)||[]