# HG changeset patch # User jbe # Date 1505226192 -7200 # Node ID 81a35235b450ad8bbb1353b9a81e887fc915038e # Parent 1adb0ad5900cc8e7a66db104cc87de5ce2dd6cee Bugfix in function "write_event_initiator_trigger" diff -r 1adb0ad5900c -r 81a35235b450 core.sql --- a/core.sql Sat Aug 05 16:10:43 2017 +0200 +++ b/core.sql Tue Sep 12 16:23:12 2017 +0200 @@ -2204,14 +2204,24 @@ "initiative_row" "initiative"%ROWTYPE; "issue_row" "issue"%ROWTYPE; "area_row" "area"%ROWTYPE; + "accepted_v" BOOLEAN = FALSE; + "rejected_v" BOOLEAN = FALSE; BEGIN IF TG_OP = 'UPDATE' THEN IF OLD."initiative_id" = NEW."initiative_id" AND - OLD."member_id" = NEW."member_id" AND - coalesce(OLD."accepted", FALSE) = coalesce(NEW."accepted", FALSE) + OLD."member_id" = NEW."member_id" THEN - RETURN NULL; + IF + coalesce(OLD."accepted", FALSE) = coalesce(NEW."accepted", FALSE) + THEN + RETURN NULL; + END IF; + IF coalesce(NEW."accepted", FALSE) = TRUE THEN + "accepted_v" := TRUE; + ELSE + "rejected_v" := TRUE; + END IF; END IF; END IF; IF (TG_OP = 'DELETE' OR TG_OP = 'UPDATE') AND NOT "accepted_v" THEN diff -r 1adb0ad5900c -r 81a35235b450 update/core-update.v3.2.2-v4.0.0.sql --- a/update/core-update.v3.2.2-v4.0.0.sql Sat Aug 05 16:10:43 2017 +0200 +++ b/update/core-update.v3.2.2-v4.0.0.sql Tue Sep 12 16:23:12 2017 +0200 @@ -1439,14 +1439,24 @@ "initiative_row" "initiative"%ROWTYPE; "issue_row" "issue"%ROWTYPE; "area_row" "area"%ROWTYPE; + "accepted_v" BOOLEAN = FALSE; + "rejected_v" BOOLEAN = FALSE; BEGIN IF TG_OP = 'UPDATE' THEN IF OLD."initiative_id" = NEW."initiative_id" AND - OLD."member_id" = NEW."member_id" AND - coalesce(OLD."accepted", FALSE) = coalesce(NEW."accepted", FALSE) + OLD."member_id" = NEW."member_id" THEN - RETURN NULL; + IF + coalesce(OLD."accepted", FALSE) = coalesce(NEW."accepted", FALSE) + THEN + RETURN NULL; + END IF; + IF coalesce(NEW."accepted", FALSE) = TRUE THEN + "accepted_v" := TRUE; + ELSE + "rejected_v" := TRUE; + END IF; END IF; END IF; IF (TG_OP = 'DELETE' OR TG_OP = 'UPDATE') AND NOT "accepted_v" THEN