Repository navigation
Conversation
Push to main
TaoziZ03
marked this pull request as ready for review
October 12, 2026 02:05
TaoziZ03
marked this pull request as draft
October 15, 2026 03:25
Select PublishingPageTransformator.CreateInPlace when no target is supplied, so in-place conversion opts in explicitly instead of relying on a null target context. Cross-site conversion keeps using the existing constructor with the resolved target context. Revert the local Framework reference changes. They only affect developer builds that set PnPFrameworkPath and are unrelated to this feature. Document that -PublishingTargetPageName is optional and that the modern page keeps the source file name when no target name is supplied, and align the changelog entry with the surrounding house style. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e36329ef-32f5-4a3e-945a-ecc5f1f68f9d
This branch has not been deployed
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.
Type
Related Issues?
Depends on pnp/pnpframework#1290, which adds the in-place publishing transformation and the
PublishingPageTransformator.CreateInPlacefactory this PR calls. This PR must not be merged before that change ships in a PnP.Framework release that thePnP.Framework 1.21.*-*reference resolves to.What is in this Pull Request ?
ConvertTo-PnPPage -PublishingPagecan convert a publishing page within the currently connected Web. The existing-TargetWebUrland-TargetConnectionparameters still select an explicit target in another site collection, and the public parameter surface of the cmdlet is unchanged.The validation that rejected
-PublishingPagewithout a target is removed. When no target parameter is supplied the cmdlet now builds the transformator throughPublishingPageTransformator.CreateInPlace, which is the companion Framework's explicit opt-in for in-place transformation. Cross-site conversion keeps using the existing constructor with the resolved target context, so its behavior is unchanged.In-place conversion is not simply "pass a null target". The publishing pipeline dereferences the target context without null checks, so the mode is expressed by using the source context as the target. Choosing that explicitly at the call site is what keeps the Framework constructors able to keep rejecting a null target for every existing caller.
The companion Framework determines the transformation mode from the actual Site and Web identities. Same-Web conversion requires an existing writable Site Pages library, retains the source publishing page, and rejects an existing target even when
-Overwriteis supplied.Help and the changelog describe publishing pages among the page types supported for conversion in the connected Web, and record that
-PublishingTargetPageNameis optional: when neither it nor-TargetPageNameis supplied, the modern page keeps the file name of the source publishing page. Because the modern page is created in the Site Pages library, that name cannot collide with the publishing page it is converted from.This PR no longer modifies
src/Commands/PnP.PowerShell.csproj. Those changes only affected developer builds that setPnPFrameworkPathand were unrelated to this feature.Validation
dotnet build src\Commands\PnP.PowerShell.csproj -c Debug -p:PnPFrameworkPath=<local pnpframework>\src\lib\.PnP.Frameworkdoes not exposeCreateInPlace. That build also still reports a pre-existingCS1705from the feed resolvingPnP.Core1.18.49 whilePnP.Framework1.21.49 references 1.18.51. The package references are unchanged by this PR.PnP.Framework.dlldoes not bring in its transitive NuGet packages. The released package supplies them, so only that local workflow is affected.PublishingPageremains optional and no additional in-place switch was introduced.The live results below were produced before the call sites were moved to
CreateInPlace. That factory supplies the same source-as-target state those runs exercised, so the observed conversion behavior is unchanged; only the way the transformator is constructed differs.-PageLayoutMappingparameter and a mapping verified against its body field and zone IDs. All 16 checked body blocks persisted. Default automatic mapping fails for this tenant's catalog item, which lacks PublishingAssociatedContentType.-Overwrite, missing Site Pages, and different-Web/same-site-collection negatives behaved as expected. Failed mapping runs produced no target page.git diff --checkpassed.Live acceptance is scoped to the tested tenant, the stock Enterprise Wiki and ArticleLeft layouts, and the supplied IPKit_Home mapping.