File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/Umbraco.Commerce.Checkout/Web Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,20 @@ namespace Umbraco.Commerce.Checkout.Web
8
8
{
9
9
public static class PublishedContentExtensions
10
10
{
11
+ // Temporary fix for AncestorOrSelf until https://github.com/umbraco/Umbraco-CMS/pull/17581 is merged in
12
+ private static IPublishedContent ? AncestorOrSelf2 ( this IPublishedContent content , string contentTypeAlias ) =>
13
+ content . ContentType . Alias == contentTypeAlias
14
+ ? content
15
+ : content . Ancestor ( contentTypeAlias ) ;
16
+
11
17
public static StoreReadOnly GetStore ( this IPublishedContent content )
12
18
{
13
19
return content . Value < StoreReadOnly > ( Cms . Constants . Properties . StorePropertyAlias , fallback : Fallback . ToAncestors ) ?? throw new StoreDataNotFoundException ( ) ;
14
20
}
15
21
16
22
public static IPublishedContent GetCheckoutPage ( this IPublishedContent content )
17
23
{
18
- return content . AncestorOrSelf ( UmbracoCommerceCheckoutConstants . ContentTypes . Aliases . CheckoutPage ) ;
24
+ return content . AncestorOrSelf2 ( UmbracoCommerceCheckoutConstants . ContentTypes . Aliases . CheckoutPage ) ! ;
19
25
}
20
26
21
27
public static IPublishedContent GetCheckoutBackPage ( this IPublishedContent content )
You can’t perform that action at this time.
0 commit comments