In the library the new insert link does not work cause the href => '#' is converted into %23.
And then it goes to he page base_path/%23 which is wrong.

CommentFileSizeAuthor
#1 fix-insert-link-2180717-1.patch625 bytesnagy.balint
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagy.balint’s picture

Status: Active » Needs review
FileSize
625 bytes

A way to make a true # fragment is to set the fragment to FALSE and external to TRUE.

Attached a patch to fix the issue.

(Of course an other solution could be to not put a # fragment there at all and simply prevent the default from JS.)

jcisio’s picture

Status: Needs review » Closed (cannot reproduce)

It's weird that it does not work. The default is already prevented with "e.preventDefault();" (dnd-library.js l336). I can not reproduce the issue.

nagy.balint’s picture

I just checked on simplytest.me on chrome 34 and the markup is as follows:
Insert
As you can see the # is converted into a %23, and my patch fixes that as it should be done with the fragment attribute and not the href attribute but fragment must have a value so this is the only way.

My comment about preventDefault was mostly meant to the other method of doing this without the #.
Usually they use # to make a link not navigate anywhere, but in fact if there is no # and preventDefault is used then it will not navigate anywhere either, so # is unnecessary in fact if preventDefault is used.

However even if we don't want to change that, there is still a problem as in this case its converted at least on chrome to something else and is certainly not the intended behaviour.

Aron Novak’s picture

Status: Closed (cannot reproduce) » Reviewed & tested by the community

As i see the patch would definitely make the things more sane, this conversion is indeed unwanted. This patch does not make any harm, but helps in this confusing situation.

jcisio’s picture

Status: Reviewed & tested by the community » Fixed

Definitely. Committed and pushed. Thanks.

  • Commit 3042e1d on 7.x-1.x authored by nagy.balint, committed by jcisio:
    Issue #2180717 by nagy.balint: Insert link does not work in library.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.