-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed issue for orphan items for sitecore 10.4 #469
Conversation
Fixed issue for orphan items for sitecore 10.4
@@ -36,6 +36,7 @@ public static string GetItemUrl(Item item, UrlOptions urlOptions) | |||
{ | |||
#if SC104 | |||
if (item?.Paths == null) return string.Empty; | |||
if (item?.Paths.FullPath.Contains("[orphan]") && item?.Parent == null) return string.Empty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
item?.Paths.FullPath is an expensive operation. This also contains magic strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muso31 Issue is coming for orphan items where item.parent is null but we cannot add only this check because for root item also parent is null. So added check for fullpath "[orphan]/renderingParameters"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muso31 Thanks for flagging. Replaced item?.Paths.FullPath check with item?.Paths.IsFullyQualified. This will come false for all orphan items.
Fixed issue for orphan items for sitecore 10.4