Hello,

I'm having a problem with a Drupal 8 site where I insert a hyperlink from the rich text editor using the button on the editor.

I set the path and click "Save" in the overlay. The link inserts fine.

I then try to insert another link, doing the same action. When I click "Save" the page redirects to "/editor/dialog/link/restricted_html" instead of inserting the link.

"restricted_html" is the name of the text format in use.

I'm unable to re-create this on a fresh install of the same version Drupal (8.2.3), but am really struggling to debug to work out what is causing it on this site in particular.

I did have the contrib linkit module enabled, but I still have the issue with it uninstalled.

Any help trying to track down what is happening here would be much appreciated.

Comments

John_B’s picture

The first thing is to check that the text format restricted_html permits the insertion of links. Assuming you set up that text format you probably know the answer. Still, it is worth double checking (when logged in with suffucient permissions, found under Configuration > Content Authoring > Text formats).

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

iancawthorne’s picture

The insertion of the first link works fine, so it's definitely not a permissions issue. It seems more likely something is going wrong with the javascript that does the link insertion and something is breaking it from working for any additional links added after the first one. Edit the page again and you can insert one new link, but not a second, and so on.

Hydrant Ltd
www.hydrant.co.uk

John_B’s picture

If there is a JS error it should show up in Chrome developer tools Console.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

iancawthorne’s picture

Yes, I would expect that too, but there are no errors in the console, with preserve log enabled too.

I have this issue with user 1 and all options are ticked on for the text format. I've also tried creating a totally new text format and get the same result.

Hydrant Ltd
www.hydrant.co.uk

John_B’s picture

As you will appreciate, diagnosis is not really possible at a distance. Still, having input from a second person is often useful. Next thing you may already have checked is whether inserting the link works without using the WYSIWYG, in manually entered html.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

iancawthorne’s picture

Yes indeed, and your help is very much appreciated. Inserting links with the RTE set to source work absolutely fine. The trigger to land on the "/editor/dialog/link/restricted_html" path only happens when clicking the "Save" button of the insert link overlay.

Hydrant Ltd
www.hydrant.co.uk

John_B’s picture

The next thing I would do is search for faulty HTML on the page. Not necessarily in the content you are creating (though that is the easiest place for faulty HTML to creep in). Faulty anywhere on the page where CKEditor is behaving incorrectly could be trigger unexpected behaviour from the editor's JS.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

iancawthorne’s picture

I think you could be on to something there. The issue occurs with the default Seven admin theme and also the Adminimal admin theme, and also the Bootstrap theme.

But it works fine using a custom sub theme of the Bootstrap theme. This is certainly progress in helping to track down the problem, but is still quite unusual, as I wouldn't have expected the Seven theme to have any problems.

Hydrant Ltd
www.hydrant.co.uk

iancawthorne’s picture

Problem solved!

This was due to the advagg module being enabled (2.0 stable release).

Here is the same issue described:
https://www.drupal.org/node/2833686 on the advagg issue queue.

Many thanks for your time helping me to track down this problem @John_B.

Hydrant Ltd
www.hydrant.co.uk

John_B’s picture

Nice D8 site, BTW. I should do something about my own dreadful D7 site, some day soon, as I have happy long-term clients but only rarely a new client.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors