Can't insert link on image (Plone 5.0.6+)

I have some sites on production server developed on 5.0.0 that have link over image. I noticed since I updated to Plone 5.0.6 it isn't possible to insert a link on image.

I will describe the steps to reproduce the problem:
create a new Plone site
upload a new image
edit default front-page and insert the image
click to insert a new link (Internal or External) on image. Nothing happens when I try to click on insert button.

I updated to Plone 5.0.7 but the problem still happens. The same problem happens on a new fresh 5.0.7 installation. Is there anyone working on this problem?

Thanks

Are there any errors in your browser console?

Inspecting the page, now I see that when I inserted the image or tried to insert a link on image there is one error in firefox console (logged-in.js): IndexSizeError: Index or size is negative or greater than the allowed amount.

Thanks for your time

Does this happen with another browser too?

Firefox error log:
IndexSizeError: Index or size is negative or greater than the allowed amount logged-in.js:7
setRng web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:7:3449
select web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:7:1234
focusElement web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:16:19666
updateImage web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:16:20398
modalShown/< web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:16:21600
dispatch web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/default.js:4:8497
b.dispatch web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/default.js:2473:9881
add/r.handle web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/default.js:4:5235

Chromium, Chrome I get another error at the same file (logged-in.js): Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.

at j.setRng (web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:7:3460)
at j.select (web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:7:1236)
at d.focusElement (web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:16:19686)
at HTMLImageElement.a.onload.a.onerror (web-07.ufscar.br:8082/silvio/++plone++production/++unique++2017-05-22T09:50:00.844483/logged-in.js:16:19815)

Safari, Edge and Internet Explorer 11: The error doesn't happen.

Thanks again

It seems to be a problem with TinyMCE, corrected in version 4.5.6.
Plone 5.0.8 already includes that update.

1 Like

I tested in Plone 5.0.8 and 5.1, and the error still happens. I also set up my instance to use TinyMCE 4.5.6, but still got the same error from Plone's logged-in.js. I have not yet been able to track down where in logged-in.js the error happens because everything breaks when I try to turn on development mode for this bundle :angry:

I do have the same problem:

Firefox: IndexSizeError: Index or size is negative or greater than the allowed amount

I am using Plone 5.0.8

Have you been able to fix it somehow?

I came up with a bit of a hack as a workaround - I'm sure there's a better way to do it, but this worked for me and avoids doing anything with the Resource Registry. Done in a custom Diazo theme

  • Make a copy of plone-logged-in.js and add it as a browser resource in your custom product
  • Edit the file to replace self.getSel().setBaseAndExtent(node, 0, node, 1); (found in two places) with self.getSel().setBaseAndExtent(node, 0, node, 0);
  • Add these rules to Diazo to have plone use your customized plone-logged-in.js
    
    
        
</after>

Hi

I have same problem on Plone 5.0.7 site. This image link is rather serious issue, especially for business users. Because they'd like to put graphic banner image link that lead the customers to their products or services detail page. Hope this issue will be solved in future Plone 5 release.

Thank you.
Shigeo Honda

There is no "5.1" yet; which beta or release candidate did you test on? From what I can see it should be fixed in mockup 2.5.0 (by upgrading tinymce -- thanks Franco) and 5.1rc1 is the first release of Plone which includes it.

But if you tested on 5.1rc1 and it still didn't work then it needs more attention.

Looks like I had tested on 5.1b3 (5.1rc1 was not yet out, but sorry for not specifying).

Just tested on 5.1rc1, and it does appear to be working!

Sorry for the late response ... your workaround did fix the problem. Thanks!!!