Dnn.Platform icon indicating copy to clipboard operation
Dnn.Platform copied to clipboard

Unable to remove site page URL

Open thabaum opened this issue 5 years ago • 8 comments

Description of bug

Page Settings > Advanced > SEO Unable to edit or remove URLs for pages

Screenshots

site-alias-unable-to-remove

Affected version

  • [x] 9.2.2
  • [x] 9.2.1
  • [x] 9.2
  • [x] 9.1.1
  • [ ] 9.1
  • [ ] 9.0

Affected browser

  • [ ] Chrome
  • [ ] Firefox
  • [ ] Safari
  • [ ] Internet Explorer
  • [ ] Edge

thabaum avatar Aug 22 '18 19:08 thabaum

Do you have more specifics? I've tried 9.2.1 and 9.2.2RC, for both manually added and automatically added page URL's, but I had no issues deleting them.

skamphuis avatar Sep 04 '18 19:09 skamphuis

please check again on DNN 9.2.2 release and report back, otherwise this issue will be fixes as "cannot reproduce". Please state also, whether you are using single language or multiple languages with or without content localization enabled.

sleupold avatar Oct 07 '18 10:10 sleupold

I remember seeing a similar situation on a site I worked on, not sure how to reproduce it but I managed to do what I needed by deleting them in the database one by one as required. Is there any rationale to not allow users to delete the automatic ones unless it is the last one available on the list?

valadas avatar Oct 07 '18 22:10 valadas

https://dnntracker.atlassian.net/browse/DNN-10814#add-comment

Another dnn user having same issue today posted here that may give more information to help cure the issue.

thabaum avatar Mar 12 '19 14:03 thabaum

Copying a snipped from the jira ticket in here:

On Dnn 9.4.0 RC with content localization enabled and one language added (fr-CA).

Created page A and went to SEO, seing this: (3 times same entry and no edit buttons) image

Then added url B and seing this: image

So multiple things are wrong here:

  1. Duplicate entries in UI
  2. Multiple entries with Active (200)
  3. Cannot edit or delete the automatically generated entries.

On the database side of things after those steps, I only have A in Tabs and only B in TabUrls, I have a feeling this is just a UI issue and the underlying behaviour is fine, so moving this to AdminExperience until the UI is looked at then we can test if the api is fine.

valadas avatar Jul 27 '19 13:07 valadas

Would anyone object to simply at least allow deleting the system generated ones and just check to ensure the user cannot delete the last Active (200) one. Does any one see a good reason to not allow modifying/deleting system-generated ones ?

valadas avatar Apr 13 '21 18:04 valadas

there should be for sure no duplicate entries, DNN should prevent adding it.

sleupold avatar Apr 13 '21 23:04 sleupold

This information shows and has a odd behavior, they seem to be duplicated but no, each entry is for a different language, even you are looking the configuration in a language the entries shown are for all languages (maybe a column for language is missing in the UI?), and this behavior seems to be diferente depending what language are you in, default or a diferente localization. The ones that have no delete options seem to be generated by query/logic, not stored in a table as the ones with the delete option. I tried to follow where this information was coming because an other odd behavior that I have with friendly urls, that display the wrong page when navigating to diferente localization. I'm not running latest DNN version, hope this helps.

madceb avatar Oct 11 '21 20:10 madceb

Has there been any work on this, very frustrating.

jahalliv avatar Nov 08 '22 00:11 jahalliv

@jahalliv please consider this is a free open source product, no reason to be frustrated here. Developers work on what they decide to work on and there has been a lot of recent major activity. Also for issues like this that are not obvious to make happen. Writing very very clear steps to reproduce from scratch may help for someone to pick it up.

valadas avatar Nov 08 '22 05:11 valadas

@jahalliv please consider this is a free open source product, no reason to be frustrated here. Developers work on what they decide to work on and there has been a lot of recent major activity. Also for issues like this that are not obvious to make happen. Writing very very clear steps to reproduce from scratch may help for someone to pick it up.

Now 2 reasons to be frustrated.

jahalliv avatar Nov 08 '22 13:11 jahalliv

As I look at this, unless someone else has different recreation steps, I'm not 100% sure this is actually an issue.

The only way that I have been able to get multiple URL's with the same path, and not able to edit is with a site with individual languages. This is expected, those are the default routes for those languages. Maybe the language should be shown here, that could help.

Custom added ones can be removed.

Renaming a page, results in a redirect from the old, but it can be removed if needed.

Does someone have solid recreation steps for this issue that can cause this issue without it being a multi language site?

mitchelsellers avatar Nov 08 '22 16:11 mitchelsellers

I did happen to me but I do not have solid recreation steps. Time providing I would like to allow them to be deleted no matter what (as long as it is not the last active one). Like I said earlier, just did not have the time to implement that.

valadas avatar Nov 08 '22 17:11 valadas

The issue description is just part of it In older versions of DNN you could add a page with a space in the name and then override the URL with a dash removing it. Can't do that anymore. When you try to add it you can't, DNN tells you its "unavailable". Turns out it was silently added as a damn automatic URL that can't be deleted.

jahalliv avatar Nov 08 '22 19:11 jahalliv

I don't believe that removing the automatic behavior of dashes/not is something that we should be doing in the provider. That would have huge implications for site behaviors.

Ideally, a concise recreation process with notes of what is expected is going to make this actionable.

mitchelsellers avatar Nov 08 '22 19:11 mitchelsellers

Then at least give the site administrator the option to delete an automatically created redirect OR the option to change it to "active". The way it works now discourages the good practice of eliminating dashes from URLs.

jahalliv avatar Nov 08 '22 19:11 jahalliv

@jahalliv I'm curious, why do you state that dashes should be removed? The current consensus still supports the usage of dashes for SEO as it is treated as a word-break from a content perspective?

mitchelsellers avatar Nov 08 '22 19:11 mitchelsellers

Straight from Google - https://developers.google.com/search/docs/crawling-indexing/url-structure

mitchelsellers avatar Nov 08 '22 19:11 mitchelsellers

Mitch, Lets stay on topic and avoid the strawman. No one wants their platform dictating their design practice to justify NOT fixing the problem. But since you brought it up why does DNN now do just that, create an automatic URL with them removed?

jahalliv avatar Nov 08 '22 19:11 jahalliv

#5401 might be the way to make this problem happen

valadas avatar Nov 23 '22 01:11 valadas

Yep, as you've noticed dashed and non-dashed URL's are added automatically for pages and can't be removed (appears to have been by design).

My fix for #5401 should fix all weird UI bugs that you've seen with lots of extra rows showing up.

In terms of adding the ability to remove the 'automatic' URL's, that seems like a reasonable feature to me. I guess I'd suggest a starting point of looking at \Dnn.Platform\Dnn.AdminExperience\Dnn.PersonaBar.Extensions\Components\Pages\PageUrlsController.cs GetPageUrls and how it generates the 'automatic' ('system') Urls in this.GetSortedUrls. The logic appears to get a wee bit complex though, and personally I'd be scared to mess with it too much.

mwigley-trilogy avatar Nov 23 '22 02:11 mwigley-trilogy

Digging into the code a bit I see that there's a matcher that has these two settings in FriendlyUrlSettings.cs

        public string RegexMatch
        {
            get { return this._regexMatch ?? (this._regexMatch = this.GetStringSetting(ValidFriendlyUrlRegexSetting, @"[^\w\d _-]")); }
            internal set { this._regexMatch = value; }
        }

        public string ReplaceSpaceWith
        {
            get
            {
                // 791 : use threadlocking option
                return this._replaceSpaceWith ?? (this._replaceSpaceWith = this.GetStringSetting(ReplaceSpaceWithSetting, "-"));
            }

            internal set { this._replaceSpaceWith = value; }
        }

edit1: I don't know how the settings stuff works, but I guess it might actually already be configurable by using the settings referenced in FriendlyUrlSettings.cs like: AUM_ValidFriendlyUrlRegex AUM_DoNotRewriteRegEx AUM_DoNotUseFriendlyUrlRegex and/or AUM_ReplaceSpaceWith

There are a bunch of other settings in FriendlyUrlSettings.cs and I suspect that at least one of them will allow disabling dashed URLs. I don't really know how the settings parsing works, but I suspect you can put something in your web.config to override the defaults.

edit2: Upon further investigation I've found that these regex settings are configurable in the UI: (settings => S E O) image image

You can at least turn off the auto-redirection to hyphenated URL's by turning off 'redirect to friendly URLs',

There's only the option to choose between two replacement characters '-' and '_', it'd probably be pretty easy for someone to add another replacement character that's an empty string.

I've found a workaround if you desperately want your URL's to never have dashes - just remove them from the 'valid characters' regex:

image

Bear in mind that I haven't tested that doing this doesn't break other things, so try it at your own risk.

mwigley-trilogy avatar Nov 23 '22 02:11 mwigley-trilogy

Yes, all of these settings still work

The history on this is that when DNN Software Acquired UrlMaster years ago, the functionality was left, but the UI was removed from the OpenSource bits.

mitchelsellers avatar Nov 23 '22 05:11 mitchelsellers