This bug have been persistent now for a couple of releases of DF and it have been driving me crazy.
I have a foreign that CAN BE nil. When I try to edit any other field and save I get that error
DreamFactory Table Module
DreamFactory Table Module: Failed to patch records in 'theme'.
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`bitnami_dreamfactory`.`theme`, CONSTRAINT `fk_theme_applock` FOREIGN KEY (`applock`) REFERENCES `app` (`id`))
API Error
Failed to patch records in 'theme'.
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`bitnami_dreamfactory`.`theme`, CONSTRAINT `fk_theme_applock` FOREIGN KEY (`applock`) REFERENCES `app` (`id`))
Obviously there is an incorrect constraint on the foreign key.
The weird thing is that if I try to clear out ONLY that foreign key then save, it does work. It only save if the current save is clearing the foreign key, if any other properties are involved in the save then it fails.
Is there any work around that issue?