# Project:Support desk

vde   Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

Archives

There are also other places where to ask: IRC, mailing lists, Q&A etc.

## Post a new question

• MediaWiki
• PHP
• Database
2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
3. To start a new thread, click "Start a new topic".

## Images and thumbnails not displayed

4

Hi,

I have exported my procedure from Bizagi Modeler 3.1 to Wiki and run with Mediawiki 1.28.

I added those settings below from my LocalSettings.php:

$wgGroupPermissions['*']['upload'] = true;$wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');

$wgEnableUploads = true;$wgAllowImageTag = true;

I allow all rights for all users on the repository below:

/mediawiki/images

The problem is that no images are displayed on my procedure and the <img> tag html have no attribute "src" .

When I set $wgAllowImageTag = false; I can see that <img> tag html have the attribute src with the image path but the <img> html tag is reconized as a text. Please, someone can help me with settings. I think I forgot to set anything else. Thanks for reply. Regards$wgFileExtensions doesn't affect what kind of file you can add to img tag. The src attribute will be dropped if it's not a valid URL (<nokiki>http://servername/path/file.ext</nokiki>). You can't use UNC URLs nor relative URLs.

09974988379

Hi Ciencia Al Poder,

I don't know what kind of file I can add to img tag because, basically, when I exported my procedure from Bizagi to Mediawiki, it make the export automatically with Bizagi type file. Sorry, I don't know how to explain but all I know is the bug came from the settings of LocalSetting.php and maybe not on $wgFileExtensions because I can see images on the repository /mediawiki/images/... Maybe it's another settings I have to allow or fill. Please, let me know if you have a solution. Thank you Reply to "Images and thumbnails not displayed" ## Opening a shell in Mediawiki 1 Hey guys I am trying to follow this direction: Type into a shell "which gs convert pdfinfo pdftotext" to see if you have the above installed first. But it obviously doesn't work in regular CMD on my Windows box so is there a way I am able to do this from Wiki? Thank you very much for your help. Chris Reply to "Opening a shell in Mediawiki" ## Trying to install PDFHandler and getting this error 4 Summary last edited by Olds98 23:48, 23 May 2017 6 days ago Sorry, I couldn't figure out how to reply, I see now there was a link to reopen it.. I am not sure why it was closed in the first place.. I am at a halt here with this PDFHandler, does anyone know what this error means? I don't know where to go next.. thank you very much Hey guys, I don't know whats going on here.. I tried posting yesterday and it said someone hid it? I installed PDFHandler and the three other packages required and even before installing the three packages I got this error now on the top of every page of my Wiki.. can someone help me? I know nothing about these Wiki's.. thanks! I am stuck! Parameter 1 to PdfHandler::registerWarningModule() expected to be a reference - Hi please don't keep creating duplicate tasks. I merely hid a blank comment. Hi guys, I am really stuck here.. is there anyone that can help me with this? I don't know where else to go.. thank you for your time. Is there a place I can perhaps contact whoever made this PDFhanlder to see if they can help me? I posted on a board from their page but they directed me here but it doesn't seem like anyone here knows what to do.. I appreciate any help.. I'm stuck.. thanks! Reply to "Trying to install PDFHandler and getting this error" ## False positives with "Ongoing user page spam" filter 1 We should re-evaluate the false positives with Special:AbuseFilter/24 . This blocked an Outreachy intern who was attempting to add a link to her blog about the project. Perhaps we could only do Disallow, and not Block. I realize that does potentially risk vandals re-trying until they bypass it, but everything's a tradeoff. Or we could tighten up the regex to not match borderline cases that might be legitimate. As is, it seems we risk false positive blocks discouraging newcomers. Reply to "False positives with "Ongoing user page spam" filter" ## Incorrect date displaying when not logged in 9 Hi, could someone help with a problem with time and dates please? I have created a number of "On this day" pages, with each one having a title with the format Month space Date, eg, "May 27", "June 1" etc. I then added the line {{#ifexist:{{#time: F j}} | *[[{{#time: F j}} | On {{#time: F j}} in SVR history]] }} This checks to see if a page with today's date exists. If it does, it creates the link and adds it to a bulleted list, if not, it returns a blank. This worked fine when logged in, but always defaulted to the date of the last page edit when not logged in, presumably because the parser function takes "the time the page was last rendered into HTML." I changed the line to {{#ifexist:{{CURRENTMONTHNAME}} {{CURRENTDAY}} | *[[{{CURRENTMONTHNAME}} {{CURRENTDAY}} | On {{CURRENTMONTHNAME}} {{CURRENTDAY}} in SVR history]] }} thinking this would force it to read the current date, but it's exactly the same. I've tried ...title=Main_Page&action=purge and that didn't fix it. It works perfectly when logged in, but as soon as I log out, it reverts back to the date of the last page edit. Is there a way of fixing this please? It's on the front page and aimed at visitors who will probably not be logged in when they see it, so I could do with having it working properly. It's at www.svrwiki.com if you want to take a look. Thanks in advance. Graham You can use purgeList.php in a cron job to be executed once a day for the pages you want to purge. I don't think there's another solution. Thanks, I looked at purgeList and that seems to rely on using a squid, which we don't. Extension:External Data linked to http://www.currenttimestamp.com/ might be a way of doing it if it was possible for Mediawiki to read the date. Another idea was to create a Bot that automatically updates the page every day at 00:01. All these are beyond my ability at the moment. Are any of them worth persevering with? There are various Mediawiki calendar or similar extensions out there. Do they all use #time: and have this same problem, or is there one that works for users who are not logged in? purgeList.php also purges the MediaWiki parser cache if you pass the --purge parameter. Thanks again. I tried purgeList.php and it's not much of a manual. With no proper explanation of how to use it, I tried everything I could think of and found it either did nothing or crashed the site. Anyway, I think I've found a way round it. Creating an internal link as an external link that looks like an internal link seems to force the wiki to use the real current time to create that link. Like this {{#ifexist:{{#time:F j|now }} | *On <span class="plainlinks">[http://www.svrwiki.com/{{#time:F_j|now}} {{#time: F j|now}} in SVR history]</span>}} I'm not sure the "now" is really needed, but my connection is so slow tonight that it's taking several minutes every time I log in, log out, preview, or save, so as it's working at last, I left it in. The underscore is needed though for an external link. As an internal link it worked OK without it. You can see the site as anon without logging out by using the private browsing option of your browser. The external link shouldn't make a difference. Maybe the use of "now" is forcing the page to not be cached? No, I tried that first, thinking that if it was going to display 0 seconds offset from 'now', that it would look up the real 'now', but it didn't work. It was while right clicking and selecting "Inspect" for various elements that I noticed times and dynamic links to internal pages based on time were coded directly in to the HTML, while external links were created live. One problem was that I've set the wiki to open internal links in the same tab and external links in a new tab. By using a full url for an internal link, it was opening in a new tab. Once it has created an external link using #time though, it sets the #time correctly for the rest of the page, so I got round it by creating an external link that is just a full stop, hidden at the bottom of the page, and an internal link, that now works, in the normal place. This {{#ifexist:{{#time:F j|now }} | *[[{{#time:F_j|now}} | On {{#time: F j|now}} in SVR history]]}} won't work on its own. As long as this {{#ifexist:{{#time:F j|now }} | <span class="plainlinks">[http://www.svrwiki.com/{{#time:F_j|now}} .]</span> }} is somewhere on the page, it will. I'm surprised this problem hasn't come up before and been solved properly. Surely most people just look at a wiki to get information, they don't bother logging in unless they are going to edit it. I know what I've done is a bit of a bodge, but it works, so hopefully it will be of use to someone else. You seem to be using an extension for such external links, because external links are generated server-side and sent with all the HTML, not "created live". The problem is not new, Help:Magic words already warns it may give incorrect results because of the cache. Maybe a simple fix is using Extension:MagicNoCache. Thanks, I didn't know about that extension, maybe that would have been an easier way to do it. I don't know if disabling the cache on the Main Page would slow it down noticeably. If so, maybe creating a page titled "Today" with the content __NOCACHE__ <includeonly>{{#time:F j}}</includeonly>, then using {{:Today}} instead of {{#time:F j}} on the Main Page would speed it up again. I suppose that would depend on whether #time got calculated before or after the transclusion. It's working now, but I might try that one anyway, just to get rid of that full stop. Reply to "Incorrect date displaying when not logged in" ## Changing the font of a wiki to a custom one 1 I have tried to change my wiki's font to no avail. I'm not sure how to approach this. I have tried editing my Common.css but it seems as if it becomes replaced by TNR or whatever. I have tried going into my skin's ".less" file and tried to attribute my font with @font-face but that completely ruined things and made it seem as if the entire site was barren of any css. Has anyone ever tried to change their wiki font? What do I have to do? MediaWiki: 1.27.3 | PHP: 5.5.38 (litespeed) | MariaDB: 10.0.27-MariaDB-cll-lve | <- I don't think these should matter at all, but just in case. Reply to "Changing the font of a wiki to a custom one" ## Google Translate 2 9 Thank you for answering my question @Ciencia Al Poder. Sorry for the duplicate topic, but I cant reply to my original one. It gave me a code and it says to add it to every page that I want it translated. Is there an easier way to wrap that code and have it displayed on all pages? Maybe through common.js? Yes, you need to insert scripts in MediaWiki:Common.js as explained in Manual:Interface/JavaScript. Note that this page will contain JavaScript code, not HTML code, so don't put <script></script> tags on it, just the contents of the script. In case you have to load a script file, add this to the page: $.getScript( "http://url.of/the/script.js" );


So should I just plainly add the contents of this: https://pastebin.com/xCc1y4yz to common.js? I tried doing it by your second suggestion $.getScript( "http://url.of/the/script.js" );, I created a mediawiki:google.js page and added its url there, but it wouldn't load it. And if the site will load it, where will it display the translation tool? No, it should be this: function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); }$.getScript( '//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit' );


The thing is, it requires the page to have a div with id "google_translate_element" (the id seems configurable on the code) where the translate button will be added. However, you can't add it easily unless you add it with JavaScript (and then load the google translate script) or edit the skin file.

I am lost. I should add the above code common.js, correct? And then edit the skin file? Like monobook.js? And add what there?

Yes, this goes to MediaWiki:Common.js

Then add this to a page to test if it works before doing anything else: <div id="google_translate_element"></div>

You'll have to see how it looks and where it should be placed in the page. Instead of editing a PHP skin file, I'd suggest adding the element with JavaScript.

Thank you! It does work, indeed. But is it possible for it to be displayed on all pages, instead of adding it manually? And is it possible to have it appear in the far right of the title?

So, at the opposite end of the title.

Ok, the complete code for this:

function googleTranslateElementInit() {
}

$(function() {$('<div id="google_translate_element">').css('float','right').insertBefore('#firstHeading');
$.getScript( '//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit' ); });  Reply to "Google Translate 2" ## DBQueryError at index.php 3 After I finish installing my wiki, and upload the LocalSettings file, I try to just head to the main index page (or the "create" page), but I get the following error: Fatal exception of type "DBQueryError" So I cannot view any page on my wiki. Right now, I have one website with two subfolders containing their own wikis. I set up one wiki a month or so ago, and it works perfectly right now. Today, I'm trying to setup a second wiki in that second subfolder, but I get that error above. Both wikis share the same user, same server, same MySQL process, etc. I'm using version 1.28.2 of mediawiki for both. I've re-downloaded the tar gz file a few times and started from scratch (after removing databses and files on the server), but no luck. I have NOT tried an older version of mediawiki, so... maybe I might need to. See Manual:How to debug for how to get more information. You would need to provide more information for us to be able to see what the error is. You can add error_reporting( -1 ); ini_set( 'display_errors', 1 );$wgShowSQLErrors = true;

\$wgDebugDumpSql = true;

## MobileFrontend Skin problems

2

Hello, I got the latest version of Mobile Frontend and can't see the menu any more if I'm using the mobile view. It seems to be a problem with the Skin Minerva, but I don't really understand what I should change to get it working. It would be great if somebody could help me!

I get the following error in my browser console:

Backtrace:

#0 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Less_Environment)

#1 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(88): Less_Tree_Ruleset->EvalMixinCalls(Less_Tree_Ruleset, Less_Environment, integer)

#2 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#3 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#4 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Parser.php(199): Less_Tree_Ruleset->compile(Less_Environment)

#14 {main}

Backtrace:

#0 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Less_Environment)

#1 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(88): Less_Tree_Ruleset->EvalMixinCalls(Less_Tree_Ruleset, Less_Environment, integer)

#2 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#3 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#4 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Parser.php(199): Less_Tree_Ruleset->compile(Less_Environment)

#14 {main}

Backtrace:

#0 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Less_Environment)

#1 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(88): Less_Tree_Ruleset->EvalMixinCalls(Less_Tree_Ruleset, Less_Environment, integer)

#2 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#3 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#4 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Parser.php(199): Less_Tree_Ruleset->compile(Less_Environment)

#14 {main}

Backtrace:

#0 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Less_Environment)

#1 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(88): Less_Tree_Ruleset->EvalMixinCalls(Less_Tree_Ruleset, Less_Environment, integer)

#2 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#3 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#4 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Parser.php(199): Less_Tree_Ruleset->compile(Less_Environment)

#14 {main}

Backtrace:

#0 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Less_Environment)

#1 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(88): Less_Tree_Ruleset->EvalMixinCalls(Less_Tree_Ruleset, Less_Environment, integer)

#2 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#3 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Less_Environment)

#4 /var/www/html/w/vendor/oyejorge/less.php/lib/Less/Parser.php(199): Less_Tree_Ruleset->compile(Less_Environment)

#14 {main}

Please explicitly mention the exact versions of MediaWiki and the MobileFrontend extension. "Latest" can be many things (latest stable tarball; latest stable git revision; latest unstable; latest provided by your Linux distribution...)

## Error with mw-config

1
Summary by Noboddy

it works with the latest update, got no idea why ¯\_(ツ)_/¯

Hello, I tried to install MW 1.29 with git and thought I was successful. But my extensions didn't show the correct version number even after I ran maintenance/update.php. So I thought I'll try the mw-config web configuration, but here I got the following error message:

[86ae26c8d74861c3c8e3d76d] /w/mw-config/?page=Upgrade Wikimedia\Rdbms\DBQueryError from line 1075 of /var/www/html/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SHOW TABLE STATUS LIKE 'revision' ESCAPE ''

Function: MysqlInstaller::preUpgrade

Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ESCAPE ''' at line 1 (localhost)

Backtrace:

#0 /var/www/html/w/includes/libs/rdbms/database/Database.php(933): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#1 /var/www/html/w/includes/installer/MysqlInstaller.php(183): Wikimedia\Rdbms\Database->query(string, string)

#2 /var/www/html/w/includes/installer/WebInstallerUpgrade.php(62): MysqlInstaller->preUpgrade()

#3 /var/www/html/w/includes/installer/WebInstaller.php(279): WebInstallerUpgrade->execute()

#4 /var/www/html/w/mw-config/index.php(81): WebInstaller->execute(array)

#5 /var/www/html/w/mw-config/index.php(39): wfInstallerMain()

#6 {main}

Is there really a problem with my database or is this a bug in the latest version of MW?

I'm using MW 1.29.0-rc.0 (5859b82) (05:03, 16. Mai 2017) and MySQL 5.7.18-0ubuntu0.16.04.1.