I ran into a problem where one of our users completed a partial import of some posts from tumblr and then broke the publish functionality of wordpress.
The publish button was replaced with a submit for review button. After searching around on the site, I found that it was caused by an SQL error. Unfortunately, wordpress doesn’t show the error, so I enabled debugging on our mysql server to watch the queries.
I noticed that the automatic draft post would insert okay, but then the next query for the ID would be incorrectly negative.
The cause of the problem was the import process. It seemed to bump up the post IDs to the maximum signed integer size that PHP could handle on the 32-bit architecture (~2 billion something). So when the new draft would be inserted and wordpress would get back the new ID, it would wrap the integer around to be negative, and the subsequent SQL queries based off of that would fail because they wouldn’t match the DB.
I had to write a custom script to crawl through our posts table and find any IDs greater than 2 billion, substract 2 billion from them and update the post_meta table as well. I then had to update the auto-increment value on the wp_posts table to start much lower so it wouldn’t keep issuing the large IDs.
The real bug is in the import process, but I’m just putting this out there as something to keep in mind to save someone else from wasting a lot of time disabling plug-ins, etc.
- The topic ‘A cause of the "submit for review" problem’ is closed to new replies.