skybrud / Skybrud.Umbraco.Redirects.Import

Import and export addon for Skybrud.Umbraco.Redirects.
MIT License
7 stars 11 forks source link

Redirects import fails for URLs with domains with segments #34

Open pedro-mpontes opened 7 months ago

pedro-mpontes commented 7 months ago

Which version of Skybrud.Umbraco.Redirects.Import are you using? (Please write the exact version, example: 4.0.1)

13.0.0

Which version of Skybrud.Umbraco.Redirects are you using? (Please write the exact version, example: 4.0.15)

13.0.4

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.0.3

Bug description

The import fails for URLs with a hostname which contains a URL culture segment:

An example:

Considering the following input: Url | DestinationUrl en/this-is-a-redirect-en | en/about nl/this-is-a-redirect-nl | nl/over-ons

When the root node is set with hostnames /en and /nl (with corresponding cultures).

The import fails.

Having looked a bit into the issue, it seems to fail to determine the destination node, which is probably related with the fact that the Umbraco method GetByRoute("nl/over-ons") returns null even when that page exists in the tree.

pedro-mpontes commented 7 months ago

https://github.com/skybrud/Skybrud.Umbraco.Redirects.Import/pull/35

abjerner commented 7 months ago

Hey @pedro-mpontes

I'm currently caught up in too many other things, so I haven't had the time to look at this yet. I will get back to you when I have some more time 😉

jcrittenden commented 7 months ago

Will this solve the fact that the Export does not include the DestinationCulture column?

Since the importer will recognize the culture from the DestinationUrl?

pedro-mpontes commented 7 months ago

Hm, that's a good point, and indeed this is intended to allow the importer to recognize the culture from the DestinationUrl, so DestinationCulture would not be needed, though it might be good to have a separate issue to add that as an option of the export anyway.