Inhalt: 
Dieser Dokumentationsartikel erklärt den Umgang mit der Nicht-Speicherung der Kategorien in unicorn 2.

THEMENVERZEICHNIS



Lesezeit: ca. 5 Minuten

Einleitung


Wenn Du in unicorn 2 die Kategorien zwar mappst, im Anschluss den Speichervorgang über den Klick auf "Dashboard" anstößt, die Kategorien aber dennoch nicht gespeichert werden. 


Ursache


Normalerweise werden nach dem Mapping-Vorgang in unicorn 2 die Kategorien gespeichert, sobald man auf "Dashboard" klickt. Nach dem erneuten Öffnen von unicorn 2 sind diese Kategorien dann grün hinterlegt.

Aktuell liegt ein Bug vor, der dazu führt, dass das Mapping wieder aufgehoben wird. 



Fehlerbehebung


Um den Fehler zu beheben, update auf die Version 2.3.0.8 von unicorn 2 oder führe die folgende Query auf der unicorn 2-Datenbank aus.


WICHTIG: Bitte lege im Vorfeld immer ein Backup deiner Datenbank, die du veränderst, an. Lasse die Query optimalerweise von jemandem ausführen, der/die sich mit SQL gut auskennt.



DROP PROCEDURE unicorn2_spSetModScheduled;

IF NOT EXISTS (SELECT * FROM sysobjects WITH (NOLOCK) WHERE name = 'unicorn2_spSetModScheduled')
EXEC('
    CREATE PROCEDURE unicorn2_spSetModScheduled (@Type VARCHAR(50), @WawiId INT, @ShopId INT, @Caller VARCHAR(50) = ''Unknown'')	AS
		BEGIN
		
			-- v 2.3.0.6_d
		
			DECLARE @cTypeLocal VARCHAR(50)
			DECLARE @kWawiIdLocal INT
			DECLARE @kShopIdLocal INT
		
			SET @cTypeLocal = @Type
			SET @kWawiIdLocal = @WawiId
			SET @kShopIdLocal = @ShopId
		
			IF(@cTypeLocal = ''Artikel'')
				BEGIN
					IF(@kWawiIdLocal > 0 AND @kShopIdLocal > 0)
						BEGIN                            
							UPDATE tArtikel
							SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
							WHERE kWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal AND cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
					
							UPDATE tArtikel
							SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  and action was (, , , ), Caller = @Caller''
							WHERE kWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal AND cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
					
							UPDATE tVariant
							SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
							WHERE kWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
					
							UPDATE tVariant
							SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  and action was (, , , ), Caller = @Caller''
							WHERE kWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
						END 				
					ELSE
						BEGIN
							IF(@kWawiIdLocal > 0)
								BEGIN
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kWawiArtId = @kWawiIdLocal AND cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0) Status was  and action was (, , , ), Caller = @Caller''
									WHERE kWawiArtId = @kWawiIdLocal AND cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kWawiArtId = @kWawiIdLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal > 0) Status was was  and action was (, , , )), Caller = @Caller''
									WHERE kWawiArtId = @kWawiIdLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
								END
							IF(@kShopIdLocal > 0)
								BEGIN
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, ShopIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, ShopIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
								END
							IF(@kWawiIdLocal = 0 AND @kShopIdLocal = 0)
								BEGIN
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL)) 
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Artikel, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
								END
						END      
				END
		
			IF(@cTypeLocal = ''Kategorie'')
				BEGIN
					IF(@kWawiIdLocal > 0 AND @kShopIdLocal > 0)
						BEGIN                            
							UPDATE tArtikel
							SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
							WHERE kSubWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal AND cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
					
							UPDATE tArtikel
							SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
							WHERE kSubWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal AND cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
					
							UPDATE tVariant
							SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
							WHERE kWawiArtId IN (SELECT kWawiArtId FROM tArtikel WHERE kSubWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal) AND kShopId = @kShopIdLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
					
							UPDATE tVariant
							SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0 AND ShopIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
							WHERE kWawiArtId IN (SELECT kWawiArtId FROM tArtikel WHERE kSubWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal) AND kShopId = @kShopIdLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
						END				
					ELSE
						BEGIN
							IF(@kWawiIdLocal > 0)
								BEGIN
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kSubWawiArtId = @kWawiIdLocal AND cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE kSubWawiArtId = @kWawiIdLocal AND cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kWawiArtId IN (SELECT kWawiArtId FROM tArtikel WHERE kSubWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal) AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE kWawiArtId IN (SELECT kWawiArtId FROM tArtikel WHERE kSubWawiArtId = @kWawiIdLocal AND kShopId = @kShopIdLocal) AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
								END
							IF(@kShopIdLocal > 0)
								BEGIN
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tArtikel                                                                                                    
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, ShopIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, ShopIdLocal > 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, ShopIdLocal > 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE kShopId = @kShopIdLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
								END
							IF(@kWawiIdLocal = 0 AND @kShopIdLocal = 0)
								BEGIN
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Add'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE cType = @cTypeLocal AND (cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL))) 
									
									UPDATE tArtikel
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cHashArtikel = ''mod by procedure SetModScheduled'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE cType = @cTypeLocal AND ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Add'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  or ( and action was (, ,  or )), Caller = @Caller''
									WHERE cStatus = ''Asserted'' OR (cStatus = ''Uploaded'' AND (cAction = ''Inactive'' OR cAction = ''Del'' OR cAction = ''None'' OR cAction IS NULL)) 
									
									UPDATE tVariant
									SET cStatus = ''Scheduled'', cAction = ''Mod'', cScheduledReason = ''Procedure: SetModScheduled: (TypeLokal = Kategorie, WawiIdLocal = 0 AND ShopIdLocal = 0) Status was  and action was (, , , )), Caller = @Caller''
									WHERE ((cStatus = ''Uploaded'' AND (cAction = ''Add'' OR cAction = ''Mod'' OR cAction = ''ModQuick'' OR cAction = ''ModQuickPrio'')))
								END
						END      
				END 
		END
');