From 5f7036a1de3b0b5bd64f1ac3170ecb1c87cb26d5 Mon Sep 17 00:00:00 2001 From: Tomi Tavela Date: Wed, 21 Dec 2016 00:03:07 +0200 Subject: [PATCH] site ContextInfo fix When accessing another site collection from the current context, the returned ContextInfo was still using the current context. new pnp.Site("https://contoso.sharepoint.com").getContextInfo().then((context: ContextInfo) => { console.log(context); }) --- src/sharepoint/rest/site.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sharepoint/rest/site.ts b/src/sharepoint/rest/site.ts index 7b43b080..845e8c28 100644 --- a/src/sharepoint/rest/site.ts +++ b/src/sharepoint/rest/site.ts @@ -41,7 +41,7 @@ export class Site extends QueryableInstance { * Gets the context information for the site. */ public getContextInfo(): Promise { - let q = new Site("", "_api/contextinfo"); + let q = new Site(this.parentUrl, "_api/contextinfo"); return q.post().then(data => { if (data.hasOwnProperty("GetContextWebInformation")) { let info = data.GetContextWebInformation;