MyBB Community Forums

Full Version: [F] [PostgreSQL] Warn User [C-Chris]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trying to warn a member when the forum is using PostgreSQL results in an error.

Reproduction Steps:

1. Go to a members profile
2. Click the "Warn" link
3. Enter an administrative note and select a warning type
4. Click "Warn User"

The following error is returned:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    22P02 - ERROR: invalid input syntax for integer: "" 
Query:
    INSERT INTO trunk_warnings (uid,tid,pid,title,points,dateline,issuedby,expires,expired,notes) VALUES ('2','1','','','2','1228664436','1','1229269236','0','Test') 

PostgreSQL 8.3.4
PHP: 5.2.6-2ubuntu4
Change in warnings.php:
237: "tid" => $warning_type['tid'],
238: "pid" => $post['pid'],
to
237: "tid" => intval($warning_type['tid']),
238: "pid" => intval($post['pid']),

And run in psql:
ALTER TABLE mybb_warnings ALTER COLUMN revokereason SET DEFAULT '';
ALTER TABLE mybb_warnings ALTER COLUMN notes SET DEFAULT '';
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group