Page MenuHomePhabricator

tinyMce: Upload/edit file fails in non-English mediawiki because of localized "File:" prefix in URL
Closed, ResolvedPublic

Description

Error

Request ID: INSERT_ID

  • Installed TinyMCE-0.2 on mediawiki-1.31.1.
  • User language is set to 'de-Deutsch'.
  • Uploaded a file (without TinyMCE) 'Osmbanner2.png'
  • Clicked button 'Upload/edit file' in TinyMCE.
  • Select: 'Upload type' : 'File in this wiki'.
  • Enter 'Osmbanner2.png' in field 'Source filename'.
  • Leave the field: You get an error from mw_upload/plugin.js line 319 because destinationFileDetails is empty:
tinymce-upload-confirm-file-not-on-wiki

Reason: In line 159 of plugins/mw_upload/plugin.js there is a comparison check

if (pageTitle.replace(/_/g," ").toLowerCase() == fileName.replace(/_/g," ").toLowerCase()) {
	fileDetails = imageURL;
}

pageTitle is 'Datei:Osmbanner2.png' (German) (returned as title by imageinfo query.
but
fileName is 'File:Osmbanner2.png' (English).

So fileDetails is always empty.

Event Timeline

Aklapper renamed this task from tinyMce, Upload/edit file fails in german mediawiki to tinyMce: Upload/edit file fails in non-English mediawiki because of localized "File:" prefix in URL.Jan 4 2019, 12:54 AM
aoxomoxoa claimed this task.
aoxomoxoa added a subscriber: aoxomoxoa.

This should no longer happen in version 1.0