Extension talk:HistoryOfPage

Running under mediawiki 1.16 (on Windows Server 2008), this gives an error.

Revision ID is passed in as param1, but this is seen as blank when getting the revision from the database:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

SELECT rev_page,rev_id FROM `vis_revision` WHERE rev_id= ORDER BY rev_id ASC LIMIT 1

from within function "hpParserFunction_Render". Database returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY rev_id ASC LIMIT 1' at line 1 (localhost)".

I've hacked this around a few times to try to figure out what's wrong. I've tried:
 * adding rev_id to the columns
 * putting the value in a variable before the selectRow call
 * literals in the function (works)
 * literals in the call (works)
 * Returning the value passed in (reports correctly)
 * Changing the magic word (no difference)

So it's fine when param1 is passed in as a literal number, but not when passed as. Sadly, I'm no PHP programmer, but I've got to say it looks fine.

Anyone else see the problem?

This is the code that fails.

//return $param1;

$dbr = wfGetDB( DB_SLAVE ); $res = $dbr->selectRow(       'revision', // $table        array( 'rev_page','rev_id' ), // $vars (columns of the table)        "rev_id=$param1", // &conds        __METHOD__, // $fname = 'Database::select',        array( 'ORDER BY' => "rev_id ASC" ) // $options = array    );