Jump to content

Topic on Extension talk:Patroller

Unknown column 'ptr_timestamp' in 'where clause'

3
Dberndtsoco (talkcontribs)

I'm really excited to use this extension but I'm getting an error:

/index.php/Special:Patroller Wikimedia\Rdbms\DBQueryError from line 160 includes/libs/rdbms/database/Database.php:

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT * FROM `page`,`recentchanges` WHERE (ptr_timestamp IS NULL) AND (rc_namespace = page_namespace) AND (rc_title = page_title) AND (rc_this_oldid = page_latest) AND (rc_user != 9) AND rc_bot = '0' AND rc_patrolled = '0' AND rc_type = '0' LIMIT 1 Function: SpecialPatroller::fetchChange

Error: 1054 Unknown column 'ptr_timestamp' in 'where clause'

I ran the update.php already. Someone on another thread said to run SQL commands, but I'm not sure specifically what script I'm missing. Did I miss a step?

Kghbln (talkcontribs)
179.218.6.69 (talkcontribs)

The code has what appears to be a huge bug, wherein it can't possibly be passing even a basic test by a developer.


Go to extensions/Patroller/SpecialPatroller.php and around line 230 you will see a select function: "$res = $dbr->select("

Just below it where it says "[ $page, $recentchanges ]," change it to "[ $page, $recentchanges, $patrollers ],"

And then a few lines later where it says "rc_user" change it to "rc_actor" (rc_user is not a field and this can't possibly be passing any level of testing)


Final result will be:

$res = $dbr->select(

           [ $page, $recentchanges, $patrollers ],

           '*',

           [

               'ptr_timestamp IS NULL',

               'rc_namespace = page_namespace',

               'rc_title = page_title',

               'rc_this_oldid = page_latest',

               'rc_actor != ' . $uid,

               'rc_bot'        => '0',

               'rc_patrolled'  => '0',

               'rc_type'       => '0',

           ],

...


Those two changes make the SQL command valid.


For any devs: you have to include the table name in the first parameter *even if you join it later*. And rc_user isn't a field so that's just bunk no matter how you cut it :p

Reply to "Unknown column 'ptr_timestamp' in 'where clause'"