Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Deprecated on September 12, 2008, 09:50:54 AM

Title: Newly upgraded 1.1.5 -> 2.0b4 Can't move topics
Post by: Deprecated on September 12, 2008, 09:50:54 AM
We just discovered that we can't move topics since the upgrade. When you try to you get an error message, "Wrong value type sent to the database. Integer expected." The topic stays where it is.

The error log shows:Wrong value type sent to the database. Integer expected.
Function: moveTopics
Apply Filter: Only show the errors from this file
File: Sources/MoveTopic.php
Line: 493


I checked the code and the file matches the original archive:    // Now that we have all the topics that *should* be marked read, and by which members...
    if (!empty($log_topics))
    {
        // Insert that information into the database!
        $smcFunc['db_insert']('replace',
            '{db_prefix}log_topics',
            array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int'),
            $log_topics,
            array('id_topic', 'id_member')
        );
    }


Line 493 is the array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int'). I checked the database and in the smf_log_topics table it has fields for id_topic mediumint( 8) , id_member mediumint( 8) and id_msg int(10). That all looks sensible to me.

I can't figure out what's wrong. I thought since it was logging I would turn off "Moderation, Administration and User Logs" but that didn't help.


BTW we do have "Include database query in error log" set.
Title: Re: Newly upgraded 1.1.5 -> 2.0b4 Can't move topics
Post by: Fustrate on September 19, 2008, 02:38:42 AM
If you're still having this problem... right before the non-working code, put
die(print_r($logs_topics));
and see if it's actually putting in three ints. That's how I usually debug weird code.
Title: Re: Newly upgraded 1.1.5 -> 2.0b4 Can't move topics
Post by: Deprecated on September 22, 2008, 09:50:25 AM
I've been considering adding a print_r statement...

I commented out the failing code and the forum seems to work fine without it. I think the failed access has to do with marking topics and posts read and adjusting the record to reflect that the topic was moved so that read or unread would still be correct.

Since the mod (hack) the urgency of this problem has lessened since we are now able to move topics okay. I've been busy with more urgent problems and will probably return to this topic soon.
Title: Re: Newly upgraded 1.1.5 -> 2.0b4 Can't move topics
Post by: ccbtimewiz on October 15, 2008, 06:47:24 PM
Is this still a problem and do you still require assistance?
Title: Re: Newly upgraded 1.1.5 -> 2.0b4 Can't move topics
Post by: Deprecated on October 15, 2008, 10:51:49 PM
Yes, I do, but I think the job is on me first, to put in the print_r and collect the data. I know one way or another I will fix it myself, but I'll appreciate any aid along the way.

This is a very rare error from what I've seen in my following support topics, but it is still non-zero so it's a real problem even if it's a problem for only a very few.

I had intended to work this today but you know how other problems seem to expand and block out the sunlight...

This is very much a live problem, for an unfortunate few. I'm glad you replied to this topic. I've been looking for it off hand for the last day or so. Nice to see it pop up. :)
Title: Re: Newly upgraded 1.1.5 -> 2.0b4 Can't move topics
Post by: Deprecated on October 17, 2008, 04:19:34 PM
I finally tracked it down with stuffing MoveTopic.php with print_r statements.

It turned out that I was getting this right before the code for database update for log_topics:

Array (