@@ -142,7 +142,7 @@ protected SqlConnection Connection
142142 {
143143 get { return connection ??= ( SqlConnection ) Database . CreateConnection ( ) ; }
144144 set { connection = value ; }
145- }
145+ }
146146
147147 [ AddInParameter ( "Shop" ) , AddInParameterEditor ( typeof ( DropDownParameterEditor ) , "none=true;" ) , AddInParameterGroup ( "Destination" ) , AddInParameterOrder ( 20 ) ]
148148 public string Shop { get ; set ; }
@@ -207,7 +207,7 @@ public override void SaveAsXml(XmlTextWriter xmlTextWriter)
207207 xmlTextWriter . WriteElementString ( "DeleteIncomingItems" , DeleteIncomingItems . ToString ( CultureInfo . CurrentCulture ) ) ;
208208 xmlTextWriter . WriteElementString ( "SqlConnectionString" , SqlConnectionString ) ;
209209 xmlTextWriter . WriteElementString ( "Shop" , Shop ) ;
210- xmlTextWriter . WriteElementString ( "DeleteProductsAndGroupForSpecificLanguage" , DeleteProductsAndGroupForSpecificLanguage . ToString ( CultureInfo . CurrentCulture ) ) ;
210+ xmlTextWriter . WriteElementString ( "DeleteProductsAndGroupForSpecificLanguage" , DeleteProductsAndGroupForSpecificLanguage . ToString ( CultureInfo . CurrentCulture ) ) ;
211211 xmlTextWriter . WriteElementString ( "RepositoriesIndexUpdate" , RepositoriesIndexUpdate ) ;
212212 xmlTextWriter . WriteElementString ( "DiscardDuplicates" , DiscardDuplicates . ToString ( CultureInfo . CurrentCulture ) ) ;
213213 xmlTextWriter . WriteElementString ( "HideDeactivatedProducts" , HideDeactivatedProducts . ToString ( CultureInfo . CurrentCulture ) ) ;
@@ -304,7 +304,7 @@ public DynamicwebProvider(XmlNode xmlNode)
304304 {
305305 DeleteProductsAndGroupForSpecificLanguage = node . FirstChild . Value == "True" ;
306306 }
307- break ;
307+ break ;
308308 case "RepositoriesIndexUpdate" :
309309 if ( node . HasChildNodes )
310310 {
@@ -346,7 +346,7 @@ public override void UpdateSourceSettings(ISource source)
346346 DynamicwebProvider newProvider = ( DynamicwebProvider ) source ;
347347 Shop = newProvider . Shop ;
348348 UserKeyField = newProvider . UserKeyField ;
349- DeactivateMissingProducts = newProvider . DeactivateMissingProducts ;
349+ DeactivateMissingProducts = newProvider . DeactivateMissingProducts ;
350350 UpdateOnlyExistingRecords = newProvider . UpdateOnlyExistingRecords ;
351351 InsertOnlyNewRecords = newProvider . InsertOnlyNewRecords ;
352352 HideDeactivatedProducts = newProvider . HideDeactivatedProducts ;
@@ -447,7 +447,6 @@ public override bool RunJob(Job job)
447447 bool deactivateMissingProducts = false ;
448448 try
449449 {
450- string defaultLanguage = Ecommerce . Services . Languages . GetDefaultLanguageId ( ) ;
451450 ReplaceMappingConditionalsWithValuesFromRequest ( job ) ;
452451 if ( Connection . State != ConnectionState . Open )
453452 Connection . Open ( ) ;
@@ -470,18 +469,16 @@ public override bool RunJob(Job job)
470469 optionValue = mapping . GetOptionValue ( "DeactivateMissingProducts" ) ;
471470 deactivateMissingProducts = optionValue . HasValue ? optionValue . Value : DeactivateMissingProducts ;
472471
473- if ( ! string . IsNullOrEmpty ( defaultLanguage ) )
472+ string defaultLanguage = Ecommerce . Services . Languages . GetDefaultLanguageId ( ) ;
473+ string destinationColumnNameForLanguageId = MappingExtensions . GetLanguageIdColumnName ( mapping . DestinationTable . Name ) ;
474+ if ( ! string . IsNullOrEmpty ( defaultLanguage ) && ! string . IsNullOrEmpty ( destinationColumnNameForLanguageId ) && ! columnMappings . Any ( obj => obj . Active && obj . DestinationColumn . Name . Equals ( destinationColumnNameForLanguageId , StringComparison . OrdinalIgnoreCase ) ) )
474475 {
475- string destinationColumnNameForLanguageId = MappingExtensions . GetLanguageIdColumnName ( mapping . DestinationTable . Name ) ;
476- if ( ! string . IsNullOrEmpty ( destinationColumnNameForLanguageId ) && ! columnMappings . Any ( obj => obj . Active && obj . DestinationColumn . Name . Equals ( destinationColumnNameForLanguageId , StringComparison . OrdinalIgnoreCase ) ) )
476+ Column randomColumn = mapping . SourceTable . Columns . First ( ) ;
477+ var languageColumnMapping = mapping . AddMapping ( randomColumn , mapping . DestinationTable . Columns . Find ( c => string . Compare ( c . Name , MappingExtensions . GetLanguageIdColumnName ( mapping . DestinationTable . Name ) , true ) == 0 ) ) ;
478+ languageColumnMapping . ScriptTypeProvider = new ConstantScriptType ( )
477479 {
478- Column randomColumn = mapping . SourceTable . Columns . First ( ) ;
479- var languageColumnMapping = mapping . AddMapping ( randomColumn , mapping . DestinationTable . Columns . Find ( c => string . Compare ( c . Name , MappingExtensions . GetLanguageIdColumnName ( mapping . DestinationTable . Name ) , true ) == 0 ) ) ;
480- languageColumnMapping . ScriptTypeProvider = new ConstantScriptType ( )
481- {
482- ScriptValue = defaultLanguage
483- } ;
484- }
480+ ScriptValue = defaultLanguage
481+ } ;
485482 }
486483
487484 if ( ! string . IsNullOrEmpty ( Shop ) )
@@ -736,7 +733,7 @@ public override string Serialize()
736733 root . Add ( CreateParameterNode ( GetType ( ) , "Remove missing rows after import in the destination tables only" , RemoveMissingAfterImportDestinationTablesOnly . ToString ( ) ) ) ;
737734 root . Add ( CreateParameterNode ( GetType ( ) , "Delete incoming rows" , DeleteIncomingItems . ToString ( ) ) ) ;
738735 root . Add ( CreateParameterNode ( GetType ( ) , "Shop" , Shop ) ) ;
739- root . Add ( CreateParameterNode ( GetType ( ) , "Delete products/groups for languages included in input" , DeleteProductsAndGroupForSpecificLanguage . ToString ( ) ) ) ;
736+ root . Add ( CreateParameterNode ( GetType ( ) , "Delete products/groups for languages included in input" , DeleteProductsAndGroupForSpecificLanguage . ToString ( ) ) ) ;
740737 root . Add ( CreateParameterNode ( GetType ( ) , "Discard duplicates" , DiscardDuplicates . ToString ( ) ) ) ;
741738 root . Add ( CreateParameterNode ( GetType ( ) , "Hide deactivated products" , HideDeactivatedProducts . ToString ( ) ) ) ;
742739 root . Add ( CreateParameterNode ( GetType ( ) , "Persist successful rows and skip failing rows" , SkipFailingRows . ToString ( ) ) ) ;
@@ -828,7 +825,7 @@ public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
828825 {
829826 options . Add ( new ( "Full" , "Full" ) ) ;
830827 options . Add ( new ( "Partial" , "Partial" ) ) ;
831- }
828+ }
832829 else
833830 {
834831 var accessuserTable = GetSchema ( ) . GetTables ( ) . Find ( t => t . Name == "AccessUser" ) ;
@@ -857,7 +854,7 @@ IEnumerable<string> IParameterVisibility.GetHiddenParameterNames(string paramete
857854 {
858855 var result = new List < string > ( ) ;
859856 switch ( parameterName )
860- {
857+ {
861858 case "Shop" :
862859 if ( string . IsNullOrEmpty ( Shop ) )
863860 result . Add ( "Shop" ) ;
0 commit comments