This error recently popped up on a website we maintain.
There is no relevant information about this on google or on other forums so if you try to search for Uncaught Error: Elementor\TemplateLibrary\Source_Local::on_save_post(): Argument #2 ($post) must be of type WP_Post, null given,
you will not find what you’re looking for, the solution to fix the Fatal Error.
This error prevents you from adding new posts, new pages, new products, new everything.
Fix the error thrown at wp-content/plugins/elementor/includes/template-library/sources/local.php on line 1138
To fix this WordPress Fatal Error that pops up whether you have Elementor with WooCommerce or not, you will have to check if the posts table has the id column as a primary key and if it is set to auto_increment.
Connect to your database or open phpMyAdmin and check if the posts table has the primary key and auto_increment set for the ID column.
Leave a Reply