pnpcore icon indicating copy to clipboard operation
pnpcore copied to clipboard

Publishing Pages Target Page URI Transformer issue

Open pkbullock opened this issue 2 years ago • 2 comments

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.

image

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, Func2 fromJsonCasting, Action1 postMappingJson, Expression1[] 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)

pkbullock avatar Oct 03 '21 20:10 pkbullock

Note this issue occurs after PR #563

pkbullock avatar Oct 03 '21 20:10 pkbullock

Isolated the fault to an issue in the ResolveAync method in SharePointTargetPageUriResolver class.

pkbullock avatar Oct 11 '21 20:10 pkbullock

Closing for now, will re-open if this effort will be picked up again

jansenbe avatar Nov 09 '23 10:11 jansenbe