Page MenuHomePhabricator

Can't undelete images, w/PostgreSQL.
Closed, ResolvedPublic

Description

Author: isaka

Description:
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:

日本語の解説をこちらに書いておきます→http://www.cory.to/kn/kn080106


Version: 1.11.x
Severity: major

Attached:

Details

Reference
bz12522

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:01 PM
bzimport set Reference to bz12522.
bzimport added a subscriber: Unknown Object (MLST).

isaka wrote:

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 :-) ).

Attached:

cbandy wrote:

Please compare this to bug #12147 a fix for the field to which you refer may be in r26043

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:25 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:21 AM
Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.