03-04-2010, 04:13 AM
I find a similar bug when we upload a file. The file is upload but opendocman don't show it or don't show the previous versions of a document uploaded.
I find a solution here:
The error is on check-in.php, line 222:
It says:
$query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision={[($lrevision_num) - 1]} WHERE id = {$_POST['id']} and revision = 'current'";
but revision is a string field on database not an integer field. With this sentence, the database save on revision field the value {1-1} for the first upload instead of 0.
So I change the line for this one:
$query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision='".intval(intval($lrevision_num) - 1)."' WHERE id = {$_POST['id']} and revision = 'current'";
Now, on database, opendocman save revision = 1.
This fix the upload error and the history versions of a file.
I hope this help.
I find a solution here:
The error is on check-in.php, line 222:
It says:
$query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision={[($lrevision_num) - 1]} WHERE id = {$_POST['id']} and revision = 'current'";
but revision is a string field on database not an integer field. With this sentence, the database save on revision field the value {1-1} for the first upload instead of 0.
So I change the line for this one:
$query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision='".intval(intval($lrevision_num) - 1)."' WHERE id = {$_POST['id']} and revision = 'current'";
Now, on database, opendocman save revision = 1.
This fix the upload error and the history versions of a file.
I hope this help.