Skip to content

Commit 5cb3b9e

Browse files
author
Aaron Bickle
committed
Fixing multi-lingual import processor.
1 parent 81f3577 commit 5cb3b9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

App_Data/Unicorn/SPE/Extensions/DataSync/DataSync/Functions/Module Functions/Invoke-ProcessSourceItems.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ SharedFields:
105105
106106
if((Test-Path -Path $path)) {
107107
Write-Host "- [!] Item exists at path $($path)"
108-
$destinationItem = Get-Item -Path $path
108+
$destinationItem = Get-Item -Path $path -Language $langCode
109109
}
110110
111111
if(!$destinationItem -and $langCode -eq "en") {
@@ -122,9 +122,8 @@ SharedFields:
122122
$lookupValue = Invoke-Expression -Command $fieldMappings[$itemSyncFieldName]
123123
$existingEnglishItems = $destinationRoot.Axes.GetDescendants() | Where-Object { $_.TemplateId -eq $importTemplateId -and $($_.Language.Name) -eq "en" -and $_.Fields[$itemSyncFieldName].Value -eq $lookupValue }
124124
125-
$existingEnglishItem = $existingEnglishItems | Select-Object -Index 0
126-
127125
if ($existingEnglishItems.count -gt 1) {
126+
$existingEnglishItem = $existingEnglishItems | Select-Object -Index 0
128127
Write-Host "- [!] Multiple items for nid $($sourceItem.attributes.nid) location. Using Sitecore Item $($existingEnglishItem.ID)"
129128
}
130129

0 commit comments

Comments
 (0)