I recently updated my site to php 8.2, and ever since i've been getting a critical error when trying to view the details of a custom post. This is the error message I get when trying to view:
I've tested it offline on an older version of php and it seems to work fine, but I can't roll back the live site as the hosting provider doesn't provide php older than 8.0
So after investigating a bit more, I've discovered the error was caused by gravity forms storing dates in the database as YY/MM/DD and Toolset looking for a UNIX timestamp, and when it doesn't find one it causes the page to crash.
I'm attempting to try fix it by using the response from the thread here:
However, the function doesn't seem to run at all. I've put in my forms unique ID, the correct slug and the field ID, but when I re-test submitting a form the date still gets stored as the YY/MM/DD gravity forms version, not the UNIX one. Is that code perhaps out of date with the new PHP update or something? I'm not sure what would cause it to not work, but i've tried just about every variation, using the child functions.php, the toolset code snippet, and multiple forms and even tried changing the slug and still no luck.
If there's some sort of update needed to the snippet any advice would be greatly appreciated, otherwise I'm not quite sure how to fix the formatting to stop the pages crashing.
In addition to that, please share admin access details and problem URL where I can see the gravity form added on the frontend.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
The topic ‘[Closed] Critical Error with php update’ is closed to new replies.