Last modified: 2012-08-04 20:49:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12522 - Can't undelete images, w/PostgreSQL.
Can't undelete images, w/PostgreSQL.
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, testme
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2008-01-05 19:35 UTC by ISAKA Yoji
Modified: 2012-08-04 20:49 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Patch for includes/SpecialUndelete.patch & includes/filerepo/LocalFile.php. (1.02 KB, patch)
2008-01-05 19:35 UTC, ISAKA Yoji
Patch for maintenance/postgres/tables.sql, for "other solution". (534 bytes, patch)
2008-01-05 20:33 UTC, ISAKA Yoji

Description ISAKA Yoji 2008-01-05 19:35:07 UTC
Created attachment 4514 [details]
Patch for includes/SpecialUndelete.patch & includes/filerepo/LocalFile.php.

System: --------------------------------------------------------------
*MediaWiki 1.11.0 + bug 12365 fixed.
*PostgreSQL 8.2.5
*FreeBSD/pc98 4.7R

Appears: -------------------------------------------------------------
*Can't view deleted image (File history) on [[Special:Undelete/Image:filename.png]].
*Can't undelete deleted images.

Error message: -------------------------------------------------------
Bad request

Invalid or badly-formed filename.

Cause: ---------------------------------------------------------------
In PostgreSQL, getting value of filearchive.fa_storage_key has space-filled by fetchObject().

maintenance/postgres/tables.sql (PostgreSQL)
    CREATE TABLE filearchive (
      fa_storage_key        CHAR(64),

Solution: ------------------------------------------------------------
Patch for includes/SpecialUndelete.patch
and includes/filerepo/LocalFile.php, and try it.

% cd /path/to/mediawiki-1.11.0
% patch < /path/to/patch

Note: ----------------------------------------------------------------
I haven't test this patch with MySQL. Please test it!

# If you want to read this document in Japanese, please see:
Comment 1 ISAKA Yoji 2008-01-05 20:33:00 UTC
Created attachment 4515 [details]
Patch for maintenance/postgres/tables.sql, for "other solution".

Other solution: ------------------------------------------------------
Change datatype of filearchive.fa_storage_key from CHAR() to VARCHAR().

If you wouldn't change source code, change maintenance/postgres/tables.sql
and rebuild filearchive table (like bug 12365 :-) ).
Comment 2 Chris Bandy 2008-01-24 18:51:56 UTC
Please compare this to bug #12147 a fix for the field to which you refer may be in r26043

Note You need to log in before you can comment on or make changes to this bug.