News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Help!: 'Wrong value type sent to the database. Integer expected. (amount)'

Started by Plutuss, May 14, 2010, 02:54:57 AM

Previous topic - Next topic

Plutuss

I get this error when trying to delete either a topic or any post. First it asks me if I'm sure I want to delete, as always, then after I press OK it shows this error:

Wrong value type sent to the database. Integer expected. (amount)




All the mods (otherwise) work great, and there were no warnings during install. I can even split and move topics fine. This is all on a new install of SMF 2.0 RC 2, with selected tables (messages, topics, members, etc.) from a previous SMF 2.0 RC 2 forum transplanted via phpAdmin. All the mods were installed post-transplant.

The only problem is this frustrating error when trying to delete.

Mods installed:


1.     Skype Integration      2.1.2       [ Uninstall ]  [ List Files ]  [ Delete ]
2.    New Topic Button    1.0    [ Uninstall ] [ List Files ] [ Delete ]
3.    Extended Registration Notifications    0.9    [ Uninstall ] [ List Files ] [ Delete ]
4.    cb|Emailogin    0.3    [ Uninstall ] [ List Files ] [ Delete ]
5.    ENotify    1.0.8    [ Uninstall ] [ List Files ] [ Delete ]
6.    PM Attachments    1.5    [ Uninstall ] [ List Files ] [ Delete ]
7.    Menu Order    0.2.3    [ Uninstall ] [ List Files ] [ Delete ]
8.    Effectively Remove SMF Logo    1.0    [ Uninstall ] [ List Files ] [ Delete ]
9.    SimplePortal    2.3.2    [ Uninstall ] [ List Files ] [ Delete ]
10.    SMF Arcade    2.5 RC1    [ Uninstall ] [ List Files ] [ Delete ]
11.    Additional Polls    1.1b    [ Uninstall ] [ List Files ] [ Delete ]
12.    Next Topic Page    1.1    [ Uninstall ] [ List Files ] [ Delete ]
13.    Force Topic Read On Login Mod    2.1    [ Uninstall ] [ List Files ] [ Delete ]
14.    RSS Feed Poster    2.1    [ Uninstall ] [ List Files ] [ Delete ]
15.    BoardHover Mod    1.6.1    [ Uninstall ] [ List Files ] [ Delete ]
16.    Karma Buttons    1.1    [ Uninstall ] [ List Files ] [ Delete ]
17.    Member Color Link    3.0.8    [ Uninstall ] [ List Files ] [ Delete ]
18.    Activity_Bar    1.0.1.2    [ Uninstall ] [ List Files ] [ Delete ]
19.    InformationBar    1.0    [ Uninstall ] [ List Files ] [ Delete ]
20.    SMF Wiki    0.1    [ Uninstall ] [ List Files ] [ Delete ]
21.    Hide ip stuff for users    1.0    [ Uninstall ] [ List Files ] [ Delete ]
22.    Posting_Announcement    2.0    [ Uninstall ] [ List Files ] [ Delete ]
23.    Advanced News    1.0    [ Uninstall ] [ List Files ] [ Delete ]
24.    EmailFlash    2.0    [ Uninstall ] [ List Files ] [ Delete ]
25.    Footnotes    1.05    [ Uninstall ] [ List Files ] [ Delete ]
26.    Menu without limit level    1.0    [ Uninstall ] [ List Files ] [ Delete ]
27.    Redirect Links    1.0.2    [ Uninstall ] [ List Files ] [ Delete ]
28.    Order News    1.0.10    [ Uninstall ] [ List Files ] [ Delete ]
29.    Birthday Posts    0.12.1 Beta    [ Uninstall ] [ List Files ] [ Delete ]
30.    Post History    0.2    [ Uninstall ] [ List Files ] [ Delete ]
31.    Member Notepad    1.0    [ Uninstall ] [ List Files ] [ Delete ]
32.    SMFShop    3.1.5.2    [ Uninstall ] [ List Files ] [ Delete ]
33.    New Topic Button    1.0    [ Uninstall ] [ List Files ] [ Delete ]
34.    BK-SMF Sub-Board    1.5    [ Uninstall ] [ List Files ] [ Delete ]
35.    Custom Field On Posting    1.2    [ Uninstall ] [ List Files ] [ Delete ]
36.    Aeva Media    1.1b    [ Uninstall ] [ List Files ] [ Delete ]
37.    Personal Messages to Membergroups    1.4.1

If anyone is able to help I would be very grateful.



JBlaze

Looks to me that it could be an error with one of your mods that affects posts. Check your forum error log for the specifics of the error and paste it here.
Jason Clemons
Former Team Member 2009 - 2012

Plutuss

I tried deleting something for a test...here is the error from the log:


Type of error: Critical

Wrong value type sent to the database. Integer expected. (amount)
Function: removeTopics

file: ...Sources/RemoveTopic.php
Line: 279


Below are lines 270 through 290:

global $smcFunc, $modSettings;
$smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET money = IF(money >= {int:amount}, money - {int:amount}, 0)
WHERE id_member = {int:member}
LIMIT 1',
array(
'amount' => $modSettings['shopPointsPerPost'],
'member' => $rowMembers['id_member'],
));
}
// End SMFShop code
}
$smcFunc['db_free_result']($requestMembers);
}

// Recycle topics that aren't in the recycle board...
if (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 && !$ignoreRecycling)
{
$request = $smcFunc['db_query']('', '
SELECT id_topic, id_board, unapproved_posts, approved

JBlaze

Jason Clemons
Former Team Member 2009 - 2012


JBlaze

It's this block of code that is giving you trouble. Contact the mod author of the SMFShop mod via the support topic for more information.

// Begin SMFShop code
while ($rowMembers = $smcFunc['db_fetch_assoc']($requestMembers))
{
updateMemberData($rowMembers['id_member'], array('posts' => 'posts - ' . $rowMembers['posts']));

global $smcFunc, $modSettings;
$smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET money = IF(money >= {int:amount}, money - {int:amount}, 0)
WHERE id_member = {int:member}
LIMIT 1',
array(
'amount' => $modSettings['shopPointsPerPost'],
'member' => $rowMembers['id_member'],
));
}
// End SMFShop code
Jason Clemons
Former Team Member 2009 - 2012

Plutuss


I just noticed something interesting. While that error persists for the boards I 'transplanted', I created a 'TRASH' board, moved some topics there, and was able to delete them in the new board without a problem.

Any ideas why there might be this difference? Thanks again.


JBlaze

Quote from: Plutuss on May 14, 2010, 04:05:27 AM

I just noticed something interesting. While that error persists for the boards I 'transplanted', I created a 'TRASH' board, moved some topics there, and was able to delete them in the new board without a problem.

Any ideas why there might be this difference? Thanks again.



Big difference. When you set up a trash board, it's not removing the topics, it's just simply sending them to the trash board.
Jason Clemons
Former Team Member 2009 - 2012

Plutuss

Quote from: JBlaze on May 14, 2010, 04:21:47 AM
Quote from: Plutuss on May 14, 2010, 04:05:27 AM

I just noticed something interesting. While that error persists for the boards I 'transplanted', I created a 'TRASH' board, moved some topics there, and was able to delete them in the new board without a problem.

Any ideas why there might be this difference? Thanks again.



Big difference. When you set up a trash board, it's not removing the topics, it's just simply sending them to the trash board.

What I mean is, that I created a brand-new board and simply named it the Rubbish Bin.

Then I created a test topic in one of the main boards, that I had transplanted in. I tried to delete it there, but got the error. But when I moved it to the Rubbish Bin (new board), and then tried to delete it while inside the Rubbish Bin board, it deleted right away.

So regardless of the Rubbish Bin's name, topics in newly-created boards will delete right away, but those in the old boards return the error. :S


JBlaze

Honestly, I have no idea. Since this is a modification problem, you would be better off asking the mod author for support since he knows his code better than anoyone else.
Jason Clemons
Former Team Member 2009 - 2012

Advertisement: