Welcome Guest, Not a member yet? Register   Sign In
POTENTIAL BUG querybuilder-save not working as intented
#1

Hi i have observed that with version 4.4.6 the save() method does not insert a row even if the primarykey value is not found in the row . I believe there might be a bug .

The save operation returns true and the parent-s Model save method chooses to update instead of insert.

The sql log shows the operation was completed

  593 Query UPDATE `UserMatches` SET `userA_ID` = '87', `userB_ID` = '65', `Score_Cn` = 12, `Score_My` = 0, `Score_Zd` = 0, `Score_Hd` = 0, `Score_Num` = 0
WHERE `UserMatches`.`matchID` IN ('87_65')
  593 Query SELECT *
FROM `UserAstroInfo`
WHERE `userID` = '87'


So its the CI4 method choosing to update instead of insert, because the matchID '87_65' is not present, I triple checked.

Also in the model the primarykey is correct .



I had to replace the save method by an alternative and it works now.
Reply
#2

Thank you for reporting, but how to reproduce?
What is `'87_65` and why is it used?
Reply
#3

(03-15-2024, 06:31 PM)kenjis Wrote: Thank you for reporting, but how to reproduce?
What is `'87_65` and why is it used?

thank you for anwering. Actually the problem came from the database triggers , they were not firing correctly due to mispell in column name.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB