liquid_feedback_core
changeset 32:3ccab7349f28 beta21
Bug in "forbid_changes_on_closed_issue_trigger"() fixed, which caused errors when closing issues under certain circumstances
author | jbe |
---|---|
date | Sun Feb 21 15:03:45 2010 +0100 (2010-02-21) |
parents | 6d634325a604 |
children | 959e5453e6c7 |
files | core.sql |
line diff
1.1 --- a/core.sql Sat Feb 20 15:09:32 2010 +0100 1.2 +++ b/core.sql Sun Feb 21 15:03:45 2010 +0100 1.3 @@ -6,7 +6,7 @@ 1.4 BEGIN; 1.5 1.6 CREATE VIEW "liquid_feedback_version" AS 1.7 - SELECT * FROM (VALUES ('beta20', NULL, NULL, NULL)) 1.8 + SELECT * FROM (VALUES ('beta21', NULL, NULL, NULL)) 1.9 AS "subquery"("string", "major", "minor", "revision"); 1.10 1.11 1.12 @@ -990,10 +990,16 @@ 1.13 RETURNS TRIGGER 1.14 LANGUAGE 'plpgsql' VOLATILE AS $$ 1.15 DECLARE 1.16 - "issue_row" "issue"%ROWTYPE; 1.17 + "issue_id_v" "issue"."id"%TYPE; 1.18 + "issue_row" "issue"%ROWTYPE; 1.19 BEGIN 1.20 + IF TG_OP = 'DELETE' THEN 1.21 + "issue_id_v" := OLD."issue_id"; 1.22 + ELSE 1.23 + "issue_id_v" := NEW."issue_id"; 1.24 + END IF; 1.25 SELECT INTO "issue_row" * FROM "issue" 1.26 - WHERE "id" = NEW."issue_id" FOR SHARE; 1.27 + WHERE "id" = "issue_id_v" FOR SHARE; 1.28 IF "issue_row"."closed" NOTNULL THEN 1.29 RAISE EXCEPTION 'Tried to modify data belonging to a closed issue.'; 1.30 END IF;