Topic on Extension talk:TinyMCE

The file does not exist on this wiki.

2
Summary by DuncanCrane

Fix added to the master branch

Leshespes (talkcontribs)

Hi. When trying to insert a "file in this wiki" I get the error "The file does not exist on this wiki. Select Ok if you would like to upload a new file or select Cancel and enter a different filename for this link".

But the file exists. Whats the problem here?

Using MW 1.32.1

DuncanCrane (talkcontribs)

Hi Leshespes

Thank you for trying this extension and letting me know about this problem.

This error would normally only be displayed if you are 'uploading' a file that already exists in the wiki (ie linking to a file that is already on the wiki). This may be by choice, eg you selected the file type of 'wiki' in the dialog, or if you tried to upload a file that already exists and have then been offered the option to link to that file.

The problem is if the destination file includes a prefix such as 'File:' (or equivalent if you have a wiki in a different language to English) as the field expects just a file name. Because the destination file name is automatically created from the source, unless it is changed manually, it will include the prefix if it was included with the source file name.

To avoid this happening, I've made a change that strips any prefix from the source when creating the destination file name when the upload type is 'wiki'.

I have uploaded a patch that is waiting review before being merged with the master branch. If you'd like to make the change soonr, please refer to the patch here

Hopefully that will fix the problem but please let me know if not. DuncanCrane (talk) 10:20, 16 June 2019 (UTC)