Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: PacoCro on April 04, 2012, 08:52:00 AM

Title: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: PacoCro on April 04, 2012, 08:52:00 AM
Started to happen on my forum. Dont know why... didnt change forum for a while and suddenly it came.


Database error:
Wrong value type sent to the database. Integer expected. (id_msg)

Link
c9fans.com/forum/c9-general-discussion/new-topic-is-here/

PS:
When I want to create a post it comes with this:

Table 'banitara_c9forum.related_subjects' doesn't exist
File: /home/banitara/public_html/woi/forum/Sources/Subs-RelatedFulltext.php
Line: 110
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: emanuele on April 04, 2012, 09:34:39 AM
Hello PacoCro and welcome to sm.org!

It seems to be related to a mod: Subs-RelatedFulltext.php is not a SMF "core" file.
A quick search on google (http://www.google.com/search?q=Subs-RelatedFulltext.php+site%3Asimplemachines.org&start=0&start=0&ie=utf-8&oe=utf-8) brought up:
http://www.simplemachines.org/community/index.php?topic=285866.0
that could solve your issue. :)
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: PacoCro on April 04, 2012, 09:43:33 AM
Thank you so much. Related topics mod was the problem. We should not use it in case we want to run forum smooth.
:)
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: emanuele on April 04, 2012, 09:52:18 AM
Well, looking closely at the error is seems that a table is missing, so either the mod was not installed properly or the table has been deleted...
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: Forumtastic on July 27, 2012, 12:10:02 AM
This just started happening to me. I do not have that mod installed.

Wrong value type sent to the database. Integer expected. (id_msg)<br />Function: MessageIndex

Sources/MessageIndex.php
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: emanuele on July 27, 2012, 07:29:17 AM
Forumtastic a bit more informations would be helpful...for example the exact error message that appears in the error log.
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: Forumtastic on July 27, 2012, 07:52:00 AM
I can't divulge our members IP addresses (I'm leaving out session information as well) for legal reasons but here is the relevant information from the error log:

id_error: 27
url: ?/board,1.0.html
message: Wrong value type sent to the database. Integer expected. (id_msg)<br />Function: MessageIndex
error type: critical
file: Sources/MessageIndex.php
line: 145

It looks like it is happening on this line:

$smcFunc['db_insert']('replace',
    '{db_prefix}log_boards',
    array('id_msg' => 'int', 'id_member' => 'int', 'id_board' => 'int'),
    array($modSettings['maxMsgID'], $user_info['id'], $board),
    array('id_member', 'id_board')
);

So it appears it has something to do with logging which boards have been seen.
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: emanuele on July 27, 2012, 08:35:17 AM
Do you have any other error message that could be related, maybe just before that one in the same file?

And also: mods installed?
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: Arantor on July 27, 2012, 10:52:41 AM
Better question, in the settings table, is there an entry for maxMsgID and if so what is it?
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: Forumtastic on July 27, 2012, 01:35:30 PM
maxMsgID = 553384

And no related errors.

It's not consistent either. It generated about 300 errors within a couple of days but most of the time, people do not receive the error. It's a very busy forum.
Title: Re: Wrong value type sent to the database. Integer expected. (id_msg)
Post by: Arantor on July 27, 2012, 06:10:53 PM
Do you have any mods related to posting?