Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | fix-insert-link-2180717-1.patch | 625 bytes | nagy.balint |
Comments
Comment #1
nagy.balint CreditAttribution: nagy.balint commentedA 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.)
Comment #2
jcisio CreditAttribution: jcisio commentedIt'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.
Comment #3
nagy.balint CreditAttribution: nagy.balint commentedI 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.
Comment #4
Aron NovakAs 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.
Comment #5
jcisio CreditAttribution: jcisio commentedDefinitely. Committed and pushed. Thanks.