Kentico MVC Rich Text Widget Page links keep breaking

Kentico Dev asked on August 6, 2020 21:12

I am using the Kentico Rich Text Widget.

We make heavy use of the ability to make links and using the GUI to select an existing page to link to:

Image Text

What I am linking to are CMS.File pages in the "Attachments" folder that we created.

Using the widget as seen above, we expect to have the URL generated as:

/Attachments/FileName.pdf

which is what happens sometimes, but more often than not, it gets saved like this: https://sample.url.com/cmsctx/pv/usersemail@email.com/culture/en-CA/wg/44d58f68-3529-4b42-8a76-dc158cdc4730/readonly/0/ea/1/h/a3ccaae02ca10fdec56554149e816d72f27c8fcb3a6dbad34cc07d5e39b8091c/-/Attachments/FileName.pdf?uh=ad96a6e3fa56d163edfb2aa4064a9a2169fb8df66a55994f37ba678aaa8e8e35

We are in no way manually entering that long URL.

That long URL does not work when normal visitors view the page. They receive broken links. But even if it did, we don't want our user names/emails exposed.

This happens seemingly randomly. Why is it changing the link sometimes and why does it contain the username of the user who saved the link?

Correct Answer

Brenden Kehren answered on August 6, 2020 21:40

When you're in the admin interface, this is expected behavior as it uses that rendered URL to get/generate the HTML for page builder to work. If you were to view the raw data in the database, it stores the relative URL you selected. If you receive an error when you are viewing the public page then you're using the wrong methods/functions to retrieve the data and output it in your view.

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.