Fixed bug with not correct PnPContext from ClientContext #676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When i use the "await PnPCoreSdk.Instance.GetPnPContextAsync" with a clientcontext with as example the following url: "https://cosmos.sharepoint.com/sites/cosmos". Then the function returns a PnPContext with the sharepoint admin url ("https://cosmos-admin.sharepoint.com/").
Steps to reproduce
Create a client context with a site url.
Use the clientcontext to create a pnpcontext with the following function: "await PnPCoreSdk.Instance.GetPnPContextAsync"
2: try it with clientcontext.Web.Context
Create a client context with a site url.
Use the clientcontext.Web.Context to create a pnpcontext with the following function: "await PnPCoreSdk.Instance.GetPnPContextAsync(web.Context as ClientContext)"
Expected behavior
Expected behavior is a copy of the clientcontext to pnpcontext.
Environment details (development & target environment)
pnp.core: 1.6.0
Additional info
I get this problem in pnp.Framework when I'm trying to get a site template then we can't find any pages because the pnp.core is target to the sharepoint admin url
I also created a issue for this but that can be closed if my fix is correct:
#671