INSERT queries for new Topic and new Post
This was originally going to be an “It’s not working!” post, but I made some progress. Now it’s “Is what I did ok?” post.
I kept getting a”This Topic is Closed” error every time I tried to create a new topic. Traced it back to the insert statement in ‘bb_insert_topic’ in functions.php. The database was responding with the error of “The value ‘ ‘ is not a valid integer for column ‘topic_id’. (I am paraphrasing, I don’t have the exact response in front of me)
I suspected it had something to do with the fact that the topic_id value is being supplied to MySql, but it is set to be an auto-increment / not null field.
So, I commented out in the $default array definition in ‘bb_insert_topic':
// 'topic_id' => false, // accepts ids or slugs
and I changed this line:
unset( $default, $defaults );
unset( $args, $defaults );
Did the same thing under the ‘bb_insert_post’ function in the same file, but for the ‘post_id’ variables.
Presto. Everything seems to work OK now.
Could this issue be specific to my version of MySql? Although it is strange, because the original query works just fine using a third party tool (SQLyog).
Has anyone encountered this issue before? Or – can anyone comment on the validity of my changes, and if they might cause issues going forward?
Finally – should this be logged as a bug?
WP 2.6, BB 1.0, IIS 6.
- You must be logged in to reply to this topic.