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

Add-ItemVersion does not copy any field values #1317

Open
DeathAngelDaemon opened this issue Nov 17, 2023 · 2 comments
Open

Add-ItemVersion does not copy any field values #1317

DeathAngelDaemon opened this issue Nov 17, 2023 · 2 comments

Comments

@DeathAngelDaemon
Copy link

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

  • 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.

@michaellwest michaellwest self-assigned this Nov 17, 2023
@michaellwest
Copy link
Member

michaellwest commented Nov 17, 2023

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.

@AdamNaj
Copy link
Member

AdamNaj commented May 12, 2024

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants