added to to handle situation where data loader was trying to add a part to a content where a part already existed with the same fromType.
This commit is contained in:
		@@ -612,7 +612,21 @@ namespace DataLoader
 | 
				
			|||||||
			if (cont != null)
 | 
								if (cont != null)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
 | 
									// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
 | 
				
			||||||
				cont.ContentParts.Add(2, secitem);
 | 
									if (cont.ContentParts.Contains(2))
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										foreach (ContentPart part in cont.ContentParts)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											if (part.FromType == 2)
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												Item ii = Item.Get(part.ItemID);
 | 
				
			||||||
 | 
												ii.MyContent.ContentParts.Add(2, secitem);
 | 
				
			||||||
 | 
												ii.Save();
 | 
				
			||||||
 | 
												break;
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										cont.ContentParts.Add(2, secitem);
 | 
				
			||||||
				if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
 | 
									if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
 | 
				
			||||||
				if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
 | 
									if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
 | 
				
			||||||
				cont.Save();
 | 
									cont.Save();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user