|
1.4.6, pgsql, 'move thread' gives SQL error
|
|
06-14-2009, 06:40 PM
Post: #1
|
|||
|
|||
|
1.4.6, pgsql, 'move thread' gives SQL error
when I just tried to 'move thread', i got the following SQL error...
Code: MyBB SQL ErrorI selected the thread in the forum view, chose move threads, clicked Go(1), on the next screen selected the target forum (a new empty one), and hit Move Threads, and got that error. using Postgres 8.3.7 on CentOS 5.3 |
|||
|
06-14-2009, 09:41 PM
(This post was last modified: 06-14-2009 09:50 PM by Pirata Nervo.)
Post: #2
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
I don't know why $tid is not valid for you.
PHP Code: $this->move_thread($tid, $thread_options['movethread'], 'redirect', $time); Edit: I am not using Postgre SQL but the input data is the same I guess. I haven't tracked down all code but from what I understood, once you execute that action ('move thread' through moderation.php - inlinethread), it runs the execute function which is part of the class custom moderation which will then execute the function move_thread which is part of the class moderation. ![]() Console World - Console World brings you the news you must know about your console, every day! |
|||
|
06-19-2009, 05:20 PM
(This post was last modified: 06-19-2009 06:25 PM by pierce.)
Post: #3
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
this is still happening to me.
i tried to instrument the move code in class_moderation and class_error to print a preset string after the sql error, but it didn't work... I don't think I .......... *OH* its bombing in move_threads, not move_thread. ok, moving instrumentation to class_moderation.php->move_threads()... $tids and $tidlist seem fine. Code: $query1 = $db->query("that, however, appears wrong. pgsql is seeing that as WHERE tid='' I don't get it, the query that fetches the list of $thread doesn't have tid as a field. Code: $query = $db->simple_select("threads", "fid, visible, replies, unapprovedposts", "tid IN ($tid_list)");and, now I find -another- error in move_thread() in class_moderation... the query at line 903 or thereabouts... PostgreSQL 8.3 is pretty strict about SQL standard compliance, and complains that the grouping in that query doesn't encompass p.visible... I fixed it as follows... Code: switch($db->type) |
|||
|
07-02-2009, 07:53 PM
Post: #4
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
bump...
this is still outstanding in 1.4.8 ... move_thread needs that SQL fix I mention in the past post (adding p.visible to the group by clause), while move_threads is still not seeing a $tid value in its arguments. |
|||
|
07-02-2009, 08:09 PM
Post: #5
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
No need to bump it - If it's in this forum we are aware of it.
![]() My Blog - My Mods |
|||
|
07-02-2009, 08:51 PM
Post: #6
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
Can you try printing $thread['tid'] ?
![]() Console World - Console World brings you the news you must know about your console, every day! |
|||
|
07-02-2009, 09:02 PM
(This post was last modified: 07-03-2009 07:03 PM by pierce.)
Post: #7
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
I just created a NEW test forum on this same machine, totally stock virgin 1.4.8 on PG 8.3.7 and CentOS 5.3, and was easily able to reproduce the move threads problem. http://mybb.freescruz.com ... if you want to register and privately identify yourself to me, i'll enable you as a moderator to test this.
I added a 1 message thread to "My Forum", then in the forum view selected the thread, and used 'inline thread moderation' to 'move threads', then chose another forum and hit 'ok' and got the same SQL error. pirata: $tids was apparently empty at the entry to move_threads() in class_moderation.php, I didn't drill down any deeper. Hey, what -is- a reasonable way to instrument this php code and display diagnostics? its not being called in a place where i can just print stuff... last time around, I created a $hack that i filled with string values, then added to the SQL error handler to print as an 'extra' ...not very effective. ok, more instrumentation on move_threads() in class_moderation.php... $tids was valid, array with single value 2 in the test case on my test forum.... inside the while($thread = $db->fetch_array($query)), $thread is... Code: Array ( [fid] => 2 [visible] => 1 [replies] => 0 [unapprovedposts] => 0 )I do -not- see a TID value here at all. in fact, the query is ... Code: $query = $db->simple_select("threads", "fid, visible, replies, unapprovedposts", "tid IN ($tid_list)");so, $thread['tid'] is, of course, null. which is the error I'm getting. I added ,tid to the select clause of that simple_select() and voila, now its working. |
|||
|
08-20-2009, 07:34 PM
Post: #8
|
|||
|
|||
|
RE: 1.4.6, pgsql, 'move thread' gives SQL error
Corresponding Ticket: http://dev.mybboard.net/issues/414
Visit MyBBSource for all your modding needs. | Free Web Proxy |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help



![[Image: mybb-plugins.png]](http://mybb-plugins.com/images/mybb-plugins.png)

![[Image: ryangordon.png]](http://files.bellomandesign.com/signatures/mybb/ryangordon.png)
