sebastian-lenz / craft-linkfield

Link field for Craft 3
MIT License
122 stars 65 forks source link

Escape SQL query in Migration #245

Closed ctangney-tulip closed 1 year ago

ctangney-tulip commented 1 year ago

Related unit(s) of work: #228

ctangney-tulip commented 1 year ago

@sebastian-lenz

sebastian-lenz commented 1 year ago

Thanks a lot!

sebastian-lenz commented 1 year ago

The release 2.1.5 containing the fix has been published.

zewVf9g3fsBigS8 commented 1 month ago

Hello Support Team we are getting this issue blow mention detail

Craft CMS version: 4 PHP version: 8.1.29 I have attached a screenshot to getting this error. Could you please assist in resolving this issue? ![Uploading Screenshot from 2024-09-18 11-14-32.png…]()

Showing this issue why Integrity constraint violation – yii\db\IntegrityException SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (adjoin_stage.changedfields, CONSTRAINT changedfields_ibfk_2 FOREIGN KEY (elementId) REFERENCES elements (id) ON DELETE CASCADE ON UPDATE CASCADE) The SQL being executed was: INSERT INTO changedfields (elementId, siteId, fieldId, dateUpdated, propagated, userId) VALUES (45935, 1, 195, '2024-09-18 09:22:47', 0, 30571) ON DUPLICATE KEY UPDATE elementId=45935, siteId=1, fieldId=195, dateUpdated='2024-09-18 09:22:47', propagated=0, userId=30571 Error Info: Array ( [0] => 23000 [1] => 1452 [2] => Cannot add or update a child row: a foreign key constraint fails (adjoin_stage.changedfields, CONSTRAINT changedfields_ibfk_2 FOREIGN KEY (elementId) REFERENCES elements (id) ON DELETE CASCADE ON UPDATE CASCADE) ) ↵ Caused by: PDOException SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (adjoin_stage.changedfields, CONSTRAINT changedfields_ibfk_2 FOREIGN KEY (elementId) REFERENCES elements (id) ON DELETE CASCADE ON UPDATE CASCADE) in /home/forge/adjoin.org/vendor/yiisoft/yii2/db/Command.php at line 1302