umbraco / Umbraco.Heartcore.Issues

3 stars 1 forks source link

Issue with child nodes being corrupted if both languages are not save and published #63

Closed Musealali closed 1 year ago

Musealali commented 2 years ago

Issue description

Describe the issue

When you have culture variance enabled and you create a Parent node and child nodes -> if you dont publish the parent node on both languages - It will corrupt ALL child nodes making them unaccessible.

In the beneath screenshot you can see the node in french being unpublished -> this is the reason for the error.

image

The beneath screenshot is the error when trying to access one of the items in the listview -> no constructive message is being returned.

image

The next sceenshot shows the error from the logviewer:

image

It seems like this issue stems from this DLL: Umbraco.Cloud.Headless.Backoffice.dll: 2.12.0.0

The code within the DLL cant process when a parent node is not published when culture variance is enabled because the parent node when not published doesn't contain a URL -> and the DLL expects a URL hence the error message:

System.ArgumentException: Value cannot be null or whitespace. Parameter name: text at Umbraco.Web.Routing.UrlInfo..ctor(String text, Boolean isUrl, String culture)

I have tested this one out on my own project: https://www.s1.umbraco.io/project/hc-muslim-test

Specifics versions

image

Is it possible to Reproduce?

Then describe the steps below

  1. Add a language (french)
  2. Create a document type for the parent node and enable culture variance in the permissions section and allow as root
  3. Create a documen type for the child node and enable culture variance in the permissions section and allow as child to the above
  4. Go to the content section create a parent node.
  5. Then create a child node in english save / publish -> try to access that child node -> everything is good
  6. Then create a child node in french save / publish -> it will throw error.
  7. Try access the child nodes in english now -> you wont be able to hence everything gets corrupted under the parent node.
  8. You should receive the error (remember not to save and publish the parent node only child nodes)

Solution

Workaround would be to save and publish the parent node in both languages

Expected behavior

Not sure if this is intended but either way we should get a much better error message. And also it should not result in ALL child nodes being corrupted (both in english and french)

Let me know if anything - PS -> Muslim Umbraco Swat.

sitereactor commented 1 year ago

We have a version 2.14.4 in development, which should fix this. @thejokerd3 please reach out if you want to verify the fix for this.

sitereactor commented 1 year ago

The update has been rolled out, so we consider this fixed unless @thejokerd3 reports back and is able to reprodue the issue.