-
-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Describe the bug
When an editor saves a draft and requests approval, the publisher will be able to see and review those drafted changes. Then when the publisher approves and publishes those changes will be lost.
A MySQL exception 'integrity constraint violation 1452' is logged when the publisher attempts to approve and publish, attached below.
If the publisher uses the regular 'Apply Draft' it saves without failing. It only occurs when the 'Approve and Publish' or 'Approve Only' options are used.
This only seems to occur for certain types of entries, particular larger ones with 30+ matrix blocks which contain large strings (eg. instagram embed code). For simpler entries with just 1 or 2 matrix blocks this issue does not occur.
SQLSTATE[23000]: Integrity constraint violation: 1452
Cannot add or update a child row: a foreign key constraint fails
(`DB_NMAE`.`elementactivity`, CONSTRAINT `fk_rpvbgloelqstdtgditjbezgrinbrvvdqiwov` FOREIGN KEY (`draftId`) REFERENCES `drafts` (`id`) ON DELETE CASCADE)
at .../vendor/yiisoft/yii2/db/Command.php:1320)"}
Steps to reproduce
- Editor edits of a relatively large entry with 30+ matrix blocks.
- Editor saves draft and makes request for approval
- Publisher views draft and uses 'Approve and Publish' or 'Approve only' to make the draft live
- Changes from draft are not in the live version
Craft CMS version
4.16.8
Plugin version
2.0.16
Multi-site?
Yes
Additional context
We have only been notified of this issue recently, but we're not certain if it may have resulted from the 2.0.14 or a later update. Thank you.