![]() |
Hi guys,
Does anyone know if there has been any changes or bug fixes regarding timestamps in the latest release? After upgrading, my original code crashes with a db exception. PHP Code: protected $useTimestamps = true; To fix, I had to actually initialise the variable as per current documentation. The original code hadn't been updated in 3 years. The requirement perhaps changed somewhere along the lines but did not see any mention of it in previous upgrade notes and it hadn't caused any trouble until now. PHP Code: protected $updatedField = ''; // set empty to prevent this field being updated Without setting updatedField to an empty string, it would add an extra date value to the INSERT string Code: INSERT INTO `log`(
Most likly a php version requiring it to be initilized.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I just went through the the change logs and did not see anytrhing to do with the model timeStamp.
Went back to 4.4.0 version. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thanks for having a look. I couldn't see anything when I quickly checked either. I guess it will be an unsolved mystery.
I would ask the developers on GitHub if they know anything about this.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Sorry, it seems because of https://github.com/codeigniter4/CodeIgniter4/pull/8193
But your past code was a misuse. See https://github.com/codeigniter4/CodeIgni...#L121-L126 $updatedField type is string, not nullable. So it should not be null (uninitialized). (01-11-2024, 03:51 AM)kenjis Wrote: Sorry, it seems because of https://github.com/codeigniter4/CodeIgniter4/pull/8193 Thanks for the response. Yes, code is wrong as per current documentation. However, I'm certain the documentation would have shown it uninitialized some time in the past (my code is over 3 years old). Simply because I'm not that clever to code CI features without examples and would have copied what was shown in the docs. This post might help those who used example code from documentation way back. |
Welcome Guest, Not a member yet? Register Sign In |