You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with SiteCollectionManager.GetSiteCollectionWithDetailsAsync as it is always returning null for root site collection. I debugged the code and found out that internally it is calling
SiteCollectionEnumerator.GetWithDetailsViaTenantAdminHiddenListAsync(PnPContext context, Uri url, VanityUrlOptions vanityUrlOptions)
which tries to get site collection passing CAML query to hidden list in tenant admin site.
However the query is not properly formatted when working with root site collection. For instance:
var hubSite = await Ctx.GetSiteCollectionManager.GetSiteCollectionWithDetailsAsync(new Uri("https://contoso.sharepoint.com"));
This does not return any results from the list and return null.
GetWithDetailsViaTenantAdminHiddenListAsync method is using url parameter which is passed as url.AbsoluteUri to the CAML query.
Instead it should be url.OriginalString or final "/" be removed.
The text was updated successfully, but these errors were encountered:
@mjonila : thanks for using PnP Core SDK and reporting this issue, I've implemented a fix which will be included in our next nightly build (version 1.8.96 or higher). Closing this issue now, please re-open if you still have issues when testing with the next nightly
There is a problem with
SiteCollectionManager.GetSiteCollectionWithDetailsAsync
as it is always returningnull
for root site collection. I debugged the code and found out that internally it is callingSiteCollectionEnumerator.GetWithDetailsViaTenantAdminHiddenListAsync(PnPContext context, Uri url, VanityUrlOptions vanityUrlOptions)
which tries to get site collection passing CAML query to hidden list in tenant admin site.
However the query is not properly formatted when working with root site collection. For instance:
var hubSite = await Ctx.GetSiteCollectionManager.GetSiteCollectionWithDetailsAsync(new Uri("https://contoso.sharepoint.com"));
queries for https://contoso.sharepoint.com/ (note final "/"), but not the original Uri.
This does not return any results from the list and return null.
GetWithDetailsViaTenantAdminHiddenListAsync
method is usingurl
parameter which is passed asurl.AbsoluteUri
to the CAML query.Instead it should be
url.OriginalString
or final "/" be removed.The text was updated successfully, but these errors were encountered: