You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Add-ItemVersion without the flag -DoNotCopyFields creates a new language version and copies all field values from the source to the target language version.
Actual Behavior
Using Add-ItemVersion without the flag -DoNotCopyFields only creates a new language version but does not copy any field values to the newly created target language version.
Make sure you have at least two languages, where one uses the other as fallback language, e.g. en and en-US (using en as fallback language)
Add new item (with at least one normal (text) field) in language "en"
Get the item via powershell command and execute Add-ItemVersion -Item $item -TargetLanguage "en-US" (without any other flags)
New en-US version is created, but the field value is not copied from en to en-US - instead it's using the fallback value.
For me it seems that the ShouldProcessField condition is not correctly evaluated and therefore no field value is copied (line 131).
Maybe the variable itemWasCreated needs to be set to true after creating the new language version in line 122.
The text was updated successfully, but these errors were encountered:
Thank you for reporting the issue. I'll have a look and see if I can reproduce it. Could you describe a sample template with fields that I can setup to reproduce the issue? Include details such as is the field shared/unversioned, etc.
@michaellwest - I cannot reproduce it, unless you can - I propose we close this. @DeathAngelDaemon - can you provide details regarding the language fallback configuration for the instance and the site the item is in?
Expected Behavior
Using
Add-ItemVersion
without the flag-DoNotCopyFields
creates a new language version and copies all field values from the source to the target language version.Actual Behavior
Using
Add-ItemVersion
without the flag-DoNotCopyFields
only creates a new language version but does not copy any field values to the newly created target language version.Steps to Reproduce the Problem
Sitecore PowerShell Extensions 6.4.0.16859
Sitecore 10.2
en
anden-US
(usingen
as fallback language)Add-ItemVersion -Item $item -TargetLanguage "en-US"
(without any other flags)en-US
version is created, but the field value is not copied fromen
toen-US
- instead it's using the fallback value.For me it seems that the
ShouldProcessField
condition is not correctly evaluated and therefore no field value is copied (line 131).Maybe the variable
itemWasCreated
needs to be set totrue
after creating the new language version in line 122.The text was updated successfully, but these errors were encountered: