From 4bd224521e1dee0bfc86410c301197fcf0cfeb66 Mon Sep 17 00:00:00 2001 From: Jaya21-git Date: Tue, 27 Aug 2024 15:58:21 +0530 Subject: [PATCH 1/5] Update SitecoreVersionAbstractions.cs Fixed issue for orphan items for sitecore 10.4 --- Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs index dcf72e6c7..5fb0845f2 100644 --- a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs +++ b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs @@ -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")) return string.Empty; var paths = item.Paths.GetPathParts(urlOptions?.UseDisplayName == true ? ItemPathType.DisplayName : ItemPathType.Name); if (paths == null || paths.Length == 0) { From 4c87b83a2e85ff1cffed1c4d0fba5dba860c7c80 Mon Sep 17 00:00:00 2001 From: Jaya21-git Date: Tue, 27 Aug 2024 20:11:16 +0530 Subject: [PATCH 2/5] Update SitecoreVersionAbstractions.cs --- Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs index 5fb0845f2..2ae99fa3d 100644 --- a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs +++ b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs @@ -36,7 +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")) return string.Empty; + if (item.Paths.FullPath.Contains("[orphan]") && item.Parent == null) return string.Empty; var paths = item.Paths.GetPathParts(urlOptions?.UseDisplayName == true ? ItemPathType.DisplayName : ItemPathType.Name); if (paths == null || paths.Length == 0) { From 1f71b81c31e90b54b9537c8591c31b00aa09f421 Mon Sep 17 00:00:00 2001 From: Jaya21-git Date: Tue, 27 Aug 2024 20:11:53 +0530 Subject: [PATCH 3/5] Update SitecoreVersionAbstractions.cs --- Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs index 2ae99fa3d..3465e0091 100644 --- a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs +++ b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs @@ -36,7 +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; + if (item?.Paths.FullPath.Contains("[orphan]") && item?.Parent == null) return string.Empty; var paths = item.Paths.GetPathParts(urlOptions?.UseDisplayName == true ? ItemPathType.DisplayName : ItemPathType.Name); if (paths == null || paths.Length == 0) { From cd995b0134c0fa2f24fce4396c4b6ab3ca59761a Mon Sep 17 00:00:00 2001 From: Jaya21-git Date: Fri, 30 Aug 2024 19:34:20 +0530 Subject: [PATCH 4/5] Update SitecoreVersionAbstractions.cs --- Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs index 3465e0091..ad9cd44fc 100644 --- a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs +++ b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs @@ -36,7 +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; + if (!item.Paths.IsFullyQualified && item.Parent == null) return string.Empty; var paths = item.Paths.GetPathParts(urlOptions?.UseDisplayName == true ? ItemPathType.DisplayName : ItemPathType.Name); if (paths == null || paths.Length == 0) { From 3b628123c7b7af6e526da2aa927ce6376a5d2162 Mon Sep 17 00:00:00 2001 From: Jaya21-git Date: Fri, 30 Aug 2024 19:39:19 +0530 Subject: [PATCH 5/5] Update SitecoreVersionAbstractions.cs --- Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs index ad9cd44fc..db655a3a7 100644 --- a/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs +++ b/Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs @@ -36,7 +36,7 @@ public static string GetItemUrl(Item item, UrlOptions urlOptions) { #if SC104 if (item?.Paths == null) return string.Empty; - if (!item.Paths.IsFullyQualified && item.Parent == null) return string.Empty; + if (!item?.Paths.IsFullyQualified && item?.Parent == null) return string.Empty; var paths = item.Paths.GetPathParts(urlOptions?.UseDisplayName == true ? ItemPathType.DisplayName : ItemPathType.Name); if (paths == null || paths.Length == 0) {