ljfio / Umbraco-InvisibleNodes

Make nodes 'invisible' in Umbraco
Apache License 2.0
1 stars 1 forks source link

Childpage with same name as parent cannot be routed #4

Closed greystate closed 4 months ago

greystate commented 4 months ago

I'm using this package in an Umbraco 13.3.0 project but have discovered a bug.

When a page has the same name as its parent, Umbraco displays an error in the Links section on the Info tab, saying that the document is published, but its URL would collide with its parent.

Steps to reproduce

First, grab the install script here from Package Script Writer and run it to install a clean v13.3.0 with InvisibleNodes v2.0.0 installed as well (script included here as well).

Install script ```shell # Ensure we have the version specific Umbraco templates dotnet new install Umbraco.Templates::13.3.0 --force dotnet new umbraco --force -n "BugTester" --friendly-name "Administrator" --email "admin@example.com" --password "1234567890" --development-database-type SQLite #Add Packages dotnet add "BugTester" package Our.Umbraco.InvisibleNodes dotnet run --project "BugTester" #Running ```
  1. Log in, using admin@example.com & 1234567890

  2. Go to Settings and Create a Document Type with Template called ContentPage and save it

  3. On the Permissions tab, enable Allow as root and select it as an allowed child node type, then save it again

  4. Go to the Content tab and create a page in the root called "PageName"

  5. Create a child page of this also called "PageName"

  6. Observe that the Info tab for the second page shows the error:

    This document is published but its URL would collide with content /PageName (id=1234)
  7. Stop the solution and remove (or comment out) the package reference in the .csproj file:

    <PackageReference Include="Our.Umbraco.InvisibleNodes" Version="2.0.0" />
  8. Run the solution again and observe that the child page now has the valid URL /pagename/

Note

ljfio commented 4 months ago

Hey @greystate, thanks for taking the time to report and include repro steps! I think I have located the bug and resolved it with the latest version of the package 2.0.1. Please give it a go and let me know if it still persists.

greystate commented 4 months ago

Thanks @ljfio 🙌 — looks like it works as expected now! 👍