Repository navigation
Fix page transformation failures caused by missing embedded documents - #1292
Merged
Merged
Conversation
Return complete empty document metadata for File Not Found responses so mappings retain the original reference without a missing-property cascade. Log actionable warnings and cover lookup, mapping, and error propagation behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d8907241-59f3-4bd6-9683-36aabb2ba370
TaoziZ03
approved these changes
Oct 19, 2026
TaoziZ03
pushed a commit
to TaoziZ03/pnpframework
that referenced
this pull request
Oct 21, 2026
TaoziZ03
added a commit
that referenced
this pull request
Oct 21, 2026
…iZ03 (#1296) * Merging of #1290. Thanks @TaoziZ03 * Merging of #1292. Thanks @YifengMao * Merging of #1295. Thanks @YifengMao * Merging of #1293. Thanks @YifengMao * Sort unreleased changelog entries by descending PR number * Restore position of checked-in changelog entry #1128 --------- Co-authored-by: titao <titao+odspmdb@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
A missing file referenced by an embedded-document web part currently aborts page migration:
DocumentEmbedLookupreturnsnull, so subsequent mapping functions fail becauseDocumentAuthorand other metadata properties are undefined. An already-broken embed should not prevent the rest of the page from migrating.Approach
System.IO.FileNotFoundException, rather than returningnull.The fallback preserves a supported embed's reference; it does not mark the embed type unsupported, recover the file, or promise working playback. A file-not-found response alone does not establish whether the URL is broken, the file was deleted, or access restrictions conceal it.
Automated verification
Executed against this implementation with .NET SDK 10.0.402, Debug configuration,
net10.0:21 passed, 0 failed, 0 skipped: 11 new document-embed cases and 10 existing image-lookup/mapping cases.
FunctionProcessor.Processcompletes; subsequent author encoding succeeds; metadata definitions and values exist; token substitution produces parseable JSON; original absolute/server-relative references remain; unavailable metadata is emptygit diff --checkpassed. The existing NU1902 warning forMicrosoft.Build.Tasks.Git8.0.0 remains outside this change.Live SharePoint verification
Performed on October 19, 2026 using certificate-based application authentication in an authorized SharePoint Online test environment. The harness referenced this worktree's patched project and used the build's embedded web-part mappings. These were real transformations followed by independent reads of the persisted pages, not only mocked lookup tests.
Two affected enterprise-wiki publishing pages were transformed in the same web into uniquely named
SitePagescopies with overwrite disabled. Tenant identifiers, exact page/media URLs, page content, authentication configuration, and raw logs are omitted from this public PR and retained locally.Additional verification:
File Not Foundduring conversion, confirming the fallback was exercised without repairing the source files.CanvasContent1.PublishCreatedPage=falsewas used, but the target library has major-only versioning and moderation disabled, so SharePoint saved the isolated copies as published major versions. No library settings were changed.Limitations