Current time: 02-09-2010, 04:11 PM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] [pgsql] Reporting posts in unmoderated forums [C-StefanT]
05-14-2009, 03:35 PM
Post: #1
[F] [pgsql] Reporting posts in unmoderated forums [C-StefanT]
If the reported posts setting is for PM or Email, and there is no set moderator for the forum, you receive this error:

Code:
SQL Error:
42883 - ERROR: function concat(text) does not exist LINE 4: LEFT JOIN mybb_usergroups g ON (((CONCAT(','|| u.addit... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

Query is found in report.php:

Code:
                    $query = $db->query("
                        SELECT u.username, u.email, u.receivepms, u.uid
                        FROM ".TABLE_PREFIX."users u
                        LEFT JOIN ".TABLE_PREFIX."usergroups g ON (((CONCAT(','|| u.additionalgroups|| ',') LIKE CONCAT('%,'|| g.gid|| ',%')) OR u.usergroup = g.gid))
                        WHERE (g.cancp=1 OR g.issupermod=1)
                    ");

As a fix, find (in report.php):

PHP Code:
                case "pgsql":
                case 
"sqlite3":
                case 
"sqlite2"

And replace with:

PHP Code:
                case "pgsql":
                    
$query $db->query("
                        SELECT u.username, u.email, u.receivepms, u.uid
                        FROM "
.TABLE_PREFIX."users u
                        LEFT JOIN "
.TABLE_PREFIX."usergroups g ON (((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
                        WHERE (g.cancp=1 OR g.issupermod=1)
                    "
);
                    break;
                case 
"sqlite3":
                case 
"sqlite2"

Tomm M
MyBB Developer » Marketing Designer & Systems Developer
Find all posts by this user
05-14-2009, 03:47 PM
Post: #2
RE: [pgsql] Reporting posts in unmoderated forums
Im pretty sure SQLite and PostgreSQL use the same thing.

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
05-14-2009, 03:51 PM
Post: #3
RE: [pgsql] Reporting posts in unmoderated forums
Thought SQLite had CONCAT... Confused

In which case, that query just needs to replace the existing one in the switch statement:

PHP Code:
                case "pgsql":
                case 
"sqlite3":
                case 
"sqlite2":
                    
$query $db->query("
                        SELECT u.username, u.email, u.receivepms, u.uid
                        FROM "
.TABLE_PREFIX."users u
                        LEFT JOIN "
.TABLE_PREFIX."usergroups g ON (((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
                        WHERE (g.cancp=1 OR g.issupermod=1)
                    "
);
                    break; 

Tomm M
MyBB Developer » Marketing Designer & Systems Developer
Find all posts by this user
05-15-2009, 11:19 AM
Post: #4
[F] [pgsql] Reporting posts in unmoderated forums
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

Tomm M
MyBB Developer » Marketing Designer & Systems Developer
Find all posts by this user


Forum Jump: