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

Javascript error when trying to edit embedded video (TinyMCE) #10737

Closed
benwallis opened this issue Sep 27, 2018 · 8 comments
Closed

Javascript error when trying to edit embedded video (TinyMCE) #10737

benwallis opened this issue Sep 27, 2018 · 8 comments
Labels
1.7.4.2 Affects versions BO Category: Back Office Duplicate Resolution: issue closed because already reported Old Products Page Concerns the old product page

Comments

@benwallis
Copy link

Describe the bug
After embedding a video in a product description, clicking on the object in the textarea causes a Javascript error to be reported in console, so the embed can not be edited.

Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Admin > Shop Parameters > General' and make sure that "Allow iframes on HTML fields" is set to "Yes"
  2. Make sure that browser developer tools are enabled (console).
  3. Go to 'Admin > Catalog' and add/edit a product
  4. Edit the "Description". Click "Insert/Edit video" button in the rich text controls toolbar. Change to the "Embed" tab. Paste in an iframe embed HTML from a YouTube video (under a video on YouTube click "Share" then "Embed" to see the iframe HTML). Click "OK".
  5. Click on the embedded grey object rectangle within the textarea.
  6. See Javascript error in browser development tools error console.

Additionnal information
PrestaShop version: 1.7.4.2
PHP version: 7.1.12

@khouloudbelguith
Copy link
Contributor

Hi @benwallis,

I did not manage to reproduce the issue with PS: 1.7.4.2.
I attached a video record.
https://drive.google.com/file/d/15czDbGJU-gzXiTu3XHjCd79cG2iR8WKD/view
Thanks to check & feedback.

Best regards, Khouloud

@khouloudbelguith khouloudbelguith added BO Category: Back Office NMI Status: issue needs more information Old Products Page Concerns the old product page 1.7.4.2 Affects versions labels Sep 27, 2018
@benwallis
Copy link
Author

Ah, it seems to only happen in Chrome browser.

I believe the issue is fixed by TinyMCE v4.5.6

@khouloudbelguith
Copy link
Contributor

HI @benwallis,

Have you the same issue with this ticket: #9651?

Best regards, Khouloud

@khouloudbelguith
Copy link
Contributor

Hi @benwallis,

Since we had no news from you for more than 30 days, I'll close this ticket. Feel free to open another one if you can give specific details.
Thanks!

@khouloudbelguith khouloudbelguith added No change required Resolution: issue closed because expected as is and removed NMI Status: issue needs more information labels Oct 30, 2018
@simulbeni
Copy link

Hi,

This issue is still there. Once you add a image and click again on that image it gives error.

Thanks

image

@khouloudbelguith
Copy link
Contributor

Hi @benwallis,

Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.

Thanks!

@benwallis
Copy link
Author

benwallis commented Dec 13, 2019

I'm not @beniwal ...

Anyway, as I mentioned above it's a known issue in TinyMCE and Chrome.

Prestashop needs to use an updated version of TinyMCE - this specific issue was fixed in TinyMCE 4.5.6 https://www.tiny.cloud/docs-4x/changelog/#version456-march302017

Latest version of TinyMCE is 5.1

See here: tinymce/tinymce#3611 (comment)
TinyMCE commit fixing the issue: tinymce/tinymce@518a3bf

Prestashop is currently using modified TinyMCE 4.0.16 released January 31 2014...
https://github.com/PrestaShop/PrestaShop/blob/develop/js/tiny_mce/tinymce.min.js

@khouloudbelguith
Copy link
Contributor

@benwallis, @beniwal,

Here's the PR: #16583 to fix the issue.
Duplicate of #11011

@khouloudbelguith khouloudbelguith added Duplicate Resolution: issue closed because already reported and removed No change required Resolution: issue closed because expected as is labels Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.4.2 Affects versions BO Category: Back Office Duplicate Resolution: issue closed because already reported Old Products Page Concerns the old product page
Projects
None yet
Development

No branches or pull requests

3 participants