-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Linking error #17272
Comments
Hi there @Jrod72! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
This could be related to #17219, but it seems a bit different. Would you be able to copy/paste the source code of your rich text editor? A "correct" link should look like this when you press the "view source" button in the rich text editor: <p><a type="document" href="/{localLink:607c17c1-d6cf-4739-b330-452436e25064}" title="About us">About us</a></p> (Notice the "type" attribute indicating whether you are linking to a document or media) |
Rewriting the code according to your example seems to have resolved the issue. The code, before editing according to above could look like:
|
@Jrod72 The code you pasted here, is that the link that works or doesn't work? |
Yes, this is one of them. All non working links seems to have been coded the same way in the rich text editor (except for which document the link is refering to and what text is being linked...). |
@Jrod72 I see. I tried pasting your link into a 14.3 Backoffice and changed the GUID to one of my images, and the link seems to work. The required attributes I'm in doubt whether we need another migration somewhere or what is going on. What did you do to your links to make them work? |
I used this code which worked in combination with re-uploading the pdf i the root catalogue in the media section (instead of having the file in a subfolder): |
The consequence is that the pdf is shown directly in the browser and I can't make it to download instead which I guess that the "open i new tab" feature makes the file to do? |
What you are saying about having to re-upload the file for it to work is surprising to me. That should definitely not be necessary! Whether a PDF opens in the browser or is downloaded has more to do with your webserver settings and whether that can serve PDFs as a stream. You can force a download of any link by adding the "download" attribute to the A-tag. Umbraco doesn't have any UI to help you set the attribute, but you can edit the source and set it manually. Here is the documentation (from MDN) detailing what it does: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download |
Investigating this a bit more, we have found that the order of the attributes on links matters. Consider a link like this taken from your example above: <a rel="noopener" data-udi="umb://media/49ce99d2e6b74583bf9fe6151858eac0" type="media" href="/{localLink:4300c622-9950-4b19-8c58-4b4feddc106b}" target="_blank" title="NPC Internal Rules 4.1"><span>NPC Internal Rules</span></a> Since 14.1, the <a type="media" href="/{localLink:4300c622-9950-4b19-8c58-4b4feddc106b}" rel="noopener" target="_blank" title="NPC Internal Rules 4.1"><span>NPC Internal Rules</span></a>
We will issue a bug fix to ensure that the order of attributes does not matter. |
@iOvergaard When do you think a fix can be released? |
@martinthogersen We are working actively on a fix for the issue with the order of attributes as mentioned above, though I'm not sure if that is the only problem @Jrod72 is experiencing. What issue specifically are you asking about? |
@iOvergaard Here’s an example: <h2>Irrelevant content</h2>
<p> </p>
<p>Irrelevant content</p>
<h4>Irrelevant content</h4>
<ul>
<li><a rel="noopener" data-udi="umb://media/d7828eeb87b240f48a547ef7ef8a1141" href="/{localLink:umb://media/d2fc77cc6b14465784d5c447da5a8cd0}" target="_blank" title="012024">Skrivbar honorarblanket </a></li>
<li><a rel="noopener noreferrer" data-udi="umb://media/21a77779b76d4e228742302dcb3ff679" type="media" href="/{localLink:4951ddb6-c15e-4569-a8d4-e9185a45201b}" target="_blank" title="Honorarblanket.pdf">Vejledning til honorarblanket </a></li>
</ul>
<h4>Irrelevant content</h4>
<ul>
<li><a rel="noopener" data-udi="umb://media/884ec34300be45139d569667632b102f" type="media" href="/{localLink:e01b8e15-7f35-4b2b-8ffb-209810fdac47}" target="_blank" title="15 012024">Skrivbar honorarblanket </a></li>
<li>Irrelevant content</li>
</ul>
<h4>Irrelevant content</h4>
<ul>
<li><a rel="noopener" data-udi="umb://media/7ff0d6b7d02a49f48edf714186e9b6dc" href="/{localLink:umb://media/7c62b60b22f04fee949ab9245112013f}" target="_blank" title="ng">Skrivbar honorarblanket</a></li>
</ul>
<p> </p> The links formatted as To resolve this, I need to remove the non-functional links using the "Remove link" feature in the editor. After that, I can insert the correct links. If I go to "Add/edit link" and select the new link from there, it does not update the link, and it remains broken. |
@martinthogersen thanks for the example, that is really helpful! The links starting with Clicking "Add/edit link" does not update anything because it thinks the link is already correct, which it is. The issue lies in the backend. You could try and move the |
This has been fixed and will be included in 15.0.0-rc2, which should be released tomorrow |
@iOvergaard Would it be possible to include in version 14 as well? |
@martinthogersen Yes possibly, but no further versions are planned for V14 as 15.0.0 is right around the corner. I have made sure to include the code in the dev branch of V14 where it will be picked up by the next version if it happens, though. Ref: 1581eb6 |
Thanks @iOvergaard for sorting the issue for me. I manually cleaned up all links and everything seems to work after that. |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
14.3.0
Bug summary
We are about to move to Umbraco Cloud from Umbraco 7.xxx. We have not yet deployed the site as we are have problems with links either to pdf documents or to other pages on the site when previewing. External links seems to work. Trying to re-link doesn't help. Either there is a "page not found" result or nothing happens.
Specifics
Example of a page where links doesn't work: https://nordic-payments-council.euwest01.umbraco.io/get-involved/becoming-a-member-of-the-npc/
Page not found: https://nordic-payments-council.euwest01.umbraco.io/%7BlocalLink:a7492aa7-e4b6-4b23-a1e0-64aab83eab4b%7D
Steps to reproduce
N.a.
Expected result / actual result
I expected the link to work or that the documents were to be downloaded.
The text was updated successfully, but these errors were encountered: