pnpcore
pnpcore copied to clipboard
Publishing Pages Target Page URI Transformer issue
Category
- [x] Bug
Describe the bug
When transforming I get a rest error because the target page URL is not well formed for the target page. E.g.
Source URL: https://capadevtest.sharepoint.com/sites/PnPSauce/en/Pages/Article-SPO-New-London-Flagship-Store.aspx
Target URI: /sites/PnPKatchup/en/Pages/Migrated_Article-SPO-New-London-Flagship-Store.aspx
the "en" and "pages" library fragments of the URL shouldn't be there.
Error Message:
Message:
Test method PnP.Core.Transformation.SharePoint.Test.TransformationTests.SharepointTransformAsync threw exception:
PnP.Core.SharePointRestServiceException: SharePoint Rest service exception
Stack Trace:
BatchClient.ProcessSharePointRestBatchResponseContent(Batch batch, String batchResponse) line 1220
BatchClient.ProcessSharePointRestBatchResponse(SPORestBatch restBatch, String batchResponse) line 1162
BatchClient.ExecuteSharePointRestBatchAsync(Batch batch) line 1013
BatchClient.ExecuteBatch(Batch batch) line 339
BaseDataModel1.BaseRetrieveAsync(ApiCall apiOverride, Func
2 fromJsonCasting, Action1 postMappingJson, Expression
1[] expressions) line 556
Web.GetFileByServerRelativeUrlAsync(String serverRelativeUrl, Expression`1[] expressions) line 513
DefaultPageGenerator.GenerateAsync(PageTransformationContext context, MappingProviderOutput mappingOutput, Uri targetPageUri, CancellationToken token) line 137
DefaultPageTransformator.TransformAsync(PageTransformationTask task, CancellationToken token) line 86
TransformationTests.SharepointTransformAsync() line 76
ThreadOperations.ExecuteWithAbortSafety(Action action)
Note this issue occurs after PR #563
Isolated the fault to an issue in the ResolveAync method in SharePointTargetPageUriResolver class.
Closing for now, will re-open if this effort will be picked up again