fix: refs #8511 ref #8511 ensure entry is editable for new entryFk in buy_beforeUpdate trigger
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Carlos Andrés 2025-01-30 18:11:30 +01:00
parent c3163df2e8
commit 672ef36501
1 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ trig:BEGIN
THEN
CALL entry_isEditable(OLD.entryFk);
CALL entry_isEditable(NEW.entryFk);
END IF;
SET NEW.editorFk = account.myUser_getId();
@ -88,11 +89,11 @@ trig:BEGIN
SET NEW.buyerFk = vBuyerFk;
END IF;
IF NOT (NEW.itemFk <=> OLD.itemFk) OR
NOT (OLD.entryFk <=> NEW.entryFk) THEN
IF NOT (NEW.itemFk <=> OLD.itemFk) OR
NOT (OLD.entryFk <=> NEW.entryFk) THEN
CREATE OR REPLACE TEMPORARY TABLE tmp.buysToCheck
SELECT NEW.id;
CALL buy_checkItem();
CALL buy_checkItem();
END IF;
END$$
DELIMITER ;