Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Add-PnPPage with Translate & TranslationLanguageCodes failures after 2nd call #2572

Closed
5 tasks
ChristopheAngot opened this issue Nov 21, 2022 · 1 comment · Fixed by #2634
Closed
5 tasks
Labels
bug Something isn't working

Comments

@ChristopheAngot
Copy link

ChristopheAngot commented Nov 21, 2022

Reporting an Issue or Missing Feature

This is an Issue, not a missing feature.

Expected behavior

No exception should be thrown when calling Add-PnPPage twice with -Translate and -TranslationLanguageCodes parameters.

Actual behavior

Second call to Add-PnPPage fails.

Steps to reproduce behavior

The site is an english communication site.

When executing the following script :


Connect-PnPOnline -Url https://YourTenantHere.sharepoint.com/sites/TestMultiLingual -Credentials WinCredHere

Add-PnPPage -Name "TestMultiA" -Translate -TranslationLanguageCodes 1036,1031 -Publish

Add-PnPPage -Name "TestMultiB" -Translate -TranslationLanguageCodes 1036,1031 -Publish

Disconnect-PnPOnline

The first Add-PnPPage suceeds, the second fails.

I'm getting the exception :

Add-PnPPage : Feature 'MultilingualPages' (ID:
24611c05-ee19-45da-955f-6602264abaf8) is already activated at scope
'https://YourTenantHere.sharepoint.com/sites/TestMultiLingual'.

The Multilingual feature was activated before script execution and languages (French - 1036 & German - 1031) were also activated.

If I "reset" the connection (Disconnect / reconnect), it works as expected (but it's ugly/ slow/ not acceptable with -Interactive):

Connect-PnPOnline -Url https://YourTenantHere.sharepoint.com/sites/TestMultiLingual -Credentials WinCredHere
Add-PnPPage -Name "TestMultiA" -Translate -TranslationLanguageCodes 1036,1031 -Publish
Disconnect-PnPOnline

Connect-PnPOnline -Url https://YourTenantHere.sharepoint.com/sites/TestMultiLingual -Credentials WinCredHere
Add-PnPPage -Name "TestMultiB" -Translate -TranslationLanguageCodes 1036,1031 -Publish
Disconnect-PnPOnline

So I assume there is some kind of intialization problems related to the check with feature activation, it seems to try to activate a feature already activated.

Note : I noticed the same behavior with Set-PnPPage

What is the version of the Cmdlet module you are running?

1.12.0

Which operating system/environment are you running PnP PowerShell on?

  • [X ] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@gautamdsheth
Copy link
Collaborator

hi @ChristopheAngot , have fixed the issue. Will be available in tomorrow's nightly build.
Thanks for reporting, much appreciated 😊🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants