Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Other places to ask for help:

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  3. To start a new thread, click "Start a new topic".
Jabowery (talkcontribs)

How does one run all cache invalidations subsequent to updating a template?

I'm making extensive use of templates to simulate what might be thought of as a "Documented Spreadsheet" and can't afford to present invalid cached HTML after an update. Moreover, I don't want to recalculate all HTML cached pages after an update since many pages may have fallen into obsolescence but not yet been deleted for historical purposes.

TheDJ (talkcontribs)

The Job_queue is responsible for updating anything that needs updating. Many wikis have not installed or effectively tweaked the processing rate of their wiki installation and that will cause updates to other pages to take long

Jabowery (talkcontribs)

I take it, then, that there is no answer to my question. Hence I must modify the maintenance/runJobs.php script to accept an argument that runs only the cache invalidations?

Bawolff (talkcontribs)

the job queue doesn't do much else in a default setup other than run cache invalidations, so its a confusing question (yes, some extensions use it for other things, but you probably aren't using them)


If your goal is to blanket clear all cache, you can do that by making a dummy edit to LocalSettings.php (makes the page update but not categories). If you need to reset all categories/other links, run refreshLinks.php

Jonathan3 (talkcontribs)

You could just leave a terminal window open and run php runJobs.php whenever you make a change to your template. I don't know of any web interface way of doing this if you don't have shell access. (Hope I'm using the right terminology here.) I guess someone could write an extension that creates a special page to do it.

Or maybe you could use Extension:MagicNoCache and add __NOCACHE__ to the pages that use the template, so that the page never gets cached and always uses the latest version of the template.

Jabowery (talkcontribs)

I already gave up on a web interface and assumed I'd have to use maintenance/runJobs.php but then I ran into a problem:

It seemed as though runJobs was doing a lot more than merely invalidating the pages that depended directly and/or indirectly on the edited template. ie: It seemed as though runJobs.php was re-rendering all of those pages. Was I mistaken?

PS: When I tried php runJobs.php --type htmlCacheUpdate it seemed as though it did a lot less work even than just invalidating dependent and/or indirectly dependent pages, ie: It seemed to be invalidating only directly dependent pages.

Bawolff (talkcontribs)

> I already gave up on a web interface

and Johnathan wrote > I don't know of any web interface way

To clarify, the web interface here would be setting $wgJobRunRate to some non zero number (e.g. 4). The two options are not mutually exclusive, you could have both command line and web job runner.

> It seemed as though runJobs.php was re-rendering all of those pages. Was I mistaken?


Yes. RunJobs.php wont invalidate all pages, but maybe you did something to invalidate other pages without realizing, or maybe they were invalidated a long time ago and the job is just running now. If you've edited a template used on every page, it will invalidate them all.

> PS: When I tried php runJobs.php --type htmlCacheUpdate it seemed as though it did a lot less work even than just invalidating dependent and/or indirectly dependent pages...

Note that htmlCacheUpdate does not fully refresh a page. If the template contains category changes, etc. Its the RefreshLinkUpdates job not the htmlCacheUpdate that does that part of the update.

> ie: It seemed to be invalidating only directly dependent pages.

Different actions might trigger different invalidations. Actions that dont effect indirect dependencies (e.g. whether a link is red or blue after a page creation) dont purge the indirect dependencies.

Jabowery (talkcontribs)

By "those pages" I was referring to "pages that depended directly and/or indirectly on the edited template". So if I understand your sentence: "If you've edited a template used on every page, it will invalidate them all," you're saying `runJobs` with no arguments will invalidate all cached renderings of "pages that depended directly and/or indirectly on the edited template" but it will not re-render (or "refresh" to use your term?) those pages. Is that correct?

Reply to "Run All Cache Invalidations"

Collection of consent before browsing a website

2
Gennievre (talkcontribs)

Hello

Is there a mediawiki extension that manages consent (to be GDPR compliant)?

A French application "tarteaucitron" does this very well on websites but I did not find where to put the script to download here https://tarteaucitron.io/fr/install/

If someone has an idea ...

Bawolff (talkcontribs)
Reply to "Collection of consent before browsing a website"

Adding external CSS and JS to wiki

6
Jonathan3 (talkcontribs)

I'd like to add Responsive Tables to my wiki. It needs the following to be added:

/* Attach the Table CSS and Javascript */
<link rel="stylesheet" href="responsive-tables.css">
<script src="responsive-tables.js"></script>

I tried to add it using Extension:Widgets but it didn't work for me (maybe because it incorporated it within the body part of the web page rather than in the head?)

I guess I could manually edit the skin, but is there a recommended way of doing this in a way that wouldn't require me to repeat it on an upgrade? Thanks.

Bawolff (talkcontribs)

Use mediawiki:common.js and mediawiki:common.css you'll need to adjust the loading code though to work from within a css / js file instead of html.

Jonathan3 (talkcontribs)

I'm a bit lost. No doubt it will seem obvious in hindsight. I pasted the CSS and JS into Common.css and Common.js respectively but still to no avail. I'll keep trying things...

Jonathan3 (talkcontribs)

I'm half way there. I added the following to a Widget page and it works. I'd just blindly copied and pasted, without adding the full URLs, the first time.

<link rel="stylesheet" href="https://zurb.com/playground/projects/responsive-tables/responsive-tables.css">
<script src="https://zurb.com/playground/projects/responsive-tables/responsive-tables.js"></script>

I would still be interested how to do it within MediaWiki. I guess I could at least use a local copy of the CSS/JS files.

Peculiar Investor (talkcontribs)

You might want to also read through Help:Cascading Style Sheets. I found it very helpful to understand how the various CSS and JS files are used. I don't see anything that specifically relates to loading external CSS and JS.

Bawolff (talkcontribs)

generally you use @import for external css, and mw.loader.load for external js

Reply to "Adding external CSS and JS to wiki"
83.229.69.94 (talkcontribs)

Hello. I use the last version of MediaWiki and timeless thememe. When I start a new line (br) i got a really big interval between lines like for a new paragraph. I want to change it for a normal (if i wouldn't press "enter" and it was the same line).

I've found to edit common.css but I didn't find this file. Where should I put this file and what should i put inside that file? Something like p {margin:bottom 0.1em}?

Bawolff (talkcontribs)

so paragraph (what happens if you hit newline twice in a row) and br tags are different. The css you mentioned would be for a p (paragraph) tag.

Reply to "Line spacing <br>"

Forgotten password with no email

5
109.213.7.154 (talkcontribs)

Hi,

I'd like to start re-using my old Wikipedia account which I made in 2014 and haven't used since 2016ish. My password doesn't seem to work. I tried resetting the password but that doesn't seem to work either, I don't receive any email; I don't know if I ever attached the account to a specific email address, maybe I didn't.

The account is called @Liberivore and apparently still exists.

Any chance of getting it back or is it dead and gone and I should make a new account?

Thank you for any assistance.

Malyacko (talkcontribs)

If you find a way to absolutely surely prove that you are the very same person who also once created that very account, then please share more info.

109.213.7.154 (talkcontribs)

Hi,

If it has an email address associated with it, my name is in that address.

If not, I found the list of contributions from that account (https://en.wikipedia.org/w/index.php?title=Special:Contributions/Liberivore&dir=prev&offset=20150422203729&target=Liberivore). One of the very first edits is to the page of my high school and, a few years later, that of my university and that of my senator. I'd be able to prove all of those things individually. I don't know if that's sufficient though as there could hypothetically be someone with very similar life-interests.

Thanks

L

90.14.219.38 (talkcontribs)

I'm not sure how this platform works. Should I ping @Malyacko ?

Bawolff (talkcontribs)

we generally dont give people back their accounts unless they have iron clad proof (e.g. the type of proof you would use in court). This is very hard to provide, most peolle would just have to create a new account. Sorry.

Reply to "Forgotten password with no email"

Pages with special characters (ä,ö,ü) are not shown after upgrade from 1.31.14 -> 1.35.2

4
80.146.191.156 (talkcontribs)

I've upgraded my wiki (extracted tar.gz, copied images, extensions and LocalSettings.php) and run php update.php without errors.

But now all my pages which contain an spcial character (e.g. ä, ö, ü) in title are not showen correctly. On "All Pages" page they are only the dots in the beginning but no link text. if i go to the article via direct link, i get an error title has a wrong UTF-8 sequence.

Didn't find anything on the internet about it. Any ideas?


My LocalSettings.php (runs perfectly with 1.31):

<?php

if( defined( 'MW_INSTALL_PATH' ) ) {

   $IP = MW_INSTALL_PATH;

} else {

   $IP = dirname( __FILE__ );

}

$path = array( $IP, "$IP/includes", "$IP/languages" );

set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );

require_once( "$IP/includes/DefaultSettings.php" );

ini_set( 'memory_limit', '128M' );

if ( $wgCommandLineMode ) {

   if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {

       die( "This script must be run from the command line\n" );

   }

}

$wgSitename         = "MOS Wiki";

$wgScriptPath       = "";

$wgScriptExtension  = ".php";

$wgEnableEmail      = false;

$wgEnableUserEmail  = false; # UPO

$wgEmergencyContact = "<mail>";

$wgPasswordSender = "<mail>";

$wgEnotifUserTalk = false; # UPO

$wgEnotifWatchlist = false; # UPO

$wgEmailAuthentication = false;

$wgDBtype           = "mysql";

$wgDBserver         = "<ip>";

$wgDBname           = "<name>";

$wgDBuser           = "<user>";

$wgDBpassword       = "<pw>";

$wgDBprefix         = "wiki_";

$wgDBTableOptions   = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

$wgMainCacheType = CACHE_NONE;

$wgMemCachedServers = array();

$wgEnableUploads       = true;

$wgSVGConverter = 'rsvg';

$wgShellLocale = "de_DE.utf8";

$wgUseTeX           = false;

$wgLocalInterwiki   = strtolower( $wgSitename );

$wgLanguageCode = "de";

$wgSecretKey = "<key>";

$wgDefaultSkin = 'vector';

$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright

$wgRightsUrl = "";

$wgRightsText = "";

$wgRightsIcon = "";

$wgDiff3 = "/usr/bin/diff3";

$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );

$wgServer = "https://<ip>";

$wgGroupPermissions['*'    ]['edit']            = false;

$wgGroupPermissions['*'    ]['createpage']      = false;

$wgGroupPermissions['*'    ]['createtalk']      = false;

$wgGroupPermissions['*'    ]['read']      = true;

$wgGroupPermissions['*'    ]['createaccount']      = false;

$wgGroupPermissions['*'    ]['writeapi']      = false;

$wgGroupPermissions['sysop']['createaccount'] = true;

$wgGroupPermissions['user']['rollback']         = true;

wfLoadSkin( 'Timeless' );

wfLoadSkin( 'MonoBook' );

wfLoadSkin( 'Vector' );

$wgLogo = "{$wgScriptPath}/images/logo.jpg";

$wgFileExtensions = array('gif','png','jpg','jpeg','svg','xls','xlsx','xlsm','doc','docx','ppt','pptx','rtf','pdf', 'zip','7z','dia','sh','vsd','vsdx');

$wgTrustedMediaFormats[]='application/x-gzip';

$wgUseAjax = true;

wfLoadExtension( 'CategoryTree' );

$wgCategoryTreeDisableCache = true;

$wgCategoryTreeDefaultOptions['mode'] = 'pages';

$wgCategoryTreeCategoryPageOptions['mode'] = 'pages';

$wgCategoryTreeSpecialPageOptions = true;

$wgCategoryTreeSidebarOptions = true;

$wgVerifyMimeType = false;

$wgMaxUploadSize = 67108864;

$wgAllowExternalImages = true;

wfLoadExtension( 'Cite' );

$wgLocaltimezone = "Europe/Berlin";

$oldtz = getenv("TZ");

putenv("TZ=$wgLocaltimezone");

$wgLocalTZoffset = date("Z") / 60;

putenv("TZ=$oldtz");

wfLoadExtension( 'WikiEditor' );

$wgDefaultUserOptions['usebetatoolbar'] = 1;

$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;

$wgDefaultUserOptions['wikieditor-preview'] = 1;

$wgDefaultUserOptions['wikieditor-publish'] = 1;

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

wfLoadExtension( 'PDFEmbed' );

$wgPdfEmbed['width'] = 800;

$wgPdfEmbed['height'] = 1090;

80.146.191.156 (talkcontribs)

maybe the db config is the problem?


MariaDB [(none)]> select table_name,engine,TABLE_COLLATION  from information_schema.tables where table_schema = '<db>';

+----------------------------+--------+-------------------+

| table_name                 | engine | TABLE_COLLATION   |

+----------------------------+--------+-------------------+

| wiki_user_properties       | InnoDB | binary            |

| wiki_uploadstash           | InnoDB | binary            |

| wiki_calendar_version      | MyISAM | latin1_swedish_ci |

| wiki_user_former_groups    | InnoDB | binary            |

| wiki_external_user         | InnoDB | binary            |

| wiki_trackbacks            | InnoDB | latin1_swedish_ci |

| wiki_revision_comment_temp | InnoDB | binary            |

| wiki_l10n_cache            | InnoDB | binary            |

| wiki_ipblocks_old          | InnoDB | latin1_swedish_ci |

| wiki_content               | InnoDB | binary            |

| wiki_user_newtalk          | MyISAM | latin1_swedish_ci |

| wiki_oldimage              | InnoDB | latin1_swedish_ci |

| wiki_watchlist             | InnoDB | latin1_swedish_ci |

| wiki_watchlist_expiry      | InnoDB | binary            |

| wiki_interwiki             | InnoDB | latin1_swedish_ci |

| wiki_actor                 | InnoDB | binary            |

| wiki_ip_changes            | InnoDB | binary            |

| wiki_bot_passwords         | InnoDB | binary            |

| wiki_langlinks             | InnoDB | latin1_swedish_ci |

| wiki_ipblocks_restrictions | InnoDB | binary            |

| wiki_user_groups           | InnoDB | latin1_swedish_ci |

| wiki_job                   | InnoDB | latin1_swedish_ci |

| wiki_revision_actor_temp   | InnoDB | binary            |

| wiki_user                  | InnoDB | latin1_swedish_ci |

| wiki_page_restrictions     | InnoDB | latin1_swedish_ci |

| wiki_recentchanges         | InnoDB | latin1_swedish_ci |

| wiki_querycache_info       | InnoDB | latin1_swedish_ci |

| wiki_querycachetwo         | InnoDB | latin1_swedish_ci |

| wiki_updatelog             | InnoDB | latin1_swedish_ci |

| wiki_ipblocks              | InnoDB | latin1_swedish_ci |

| wiki_templatelinks         | InnoDB | latin1_swedish_ci |

| wiki_page                  | InnoDB | latin1_swedish_ci |

| wiki_querycache            | InnoDB | latin1_swedish_ci |

| wiki_pagelinks             | InnoDB | latin1_swedish_ci |

| wiki_redirect              | InnoDB | latin1_swedish_ci |

| wiki_module_deps           | InnoDB | binary            |

| wiki_site_identifiers      | InnoDB | binary            |

| wiki_log_search            | InnoDB | binary            |

| wiki_protected_titles      | InnoDB | latin1_swedish_ci |

| wiki_objectcache           | InnoDB | latin1_swedish_ci |

| wiki_logging               | InnoDB | latin1_swedish_ci |

| wiki_slot_roles            | InnoDB | binary            |

| wiki_content_models        | InnoDB | binary            |

| wiki_site_stats            | InnoDB | latin1_swedish_ci |

| wiki_change_tag_def        | InnoDB | binary            |

| wiki_externallinks         | InnoDB | latin1_swedish_ci |

| wiki_categorylinks         | InnoDB | latin1_swedish_ci |

| wiki_filearchive           | InnoDB | latin1_swedish_ci |

| wiki_image                 | InnoDB | latin1_swedish_ci |

| wiki_slots                 | InnoDB | binary            |

| wiki_calendar_header       | MyISAM | latin1_swedish_ci |

| wiki_math                  | InnoDB | latin1_swedish_ci |

| wiki_text                  | InnoDB | latin1_swedish_ci |

| wiki_imagelinks            | InnoDB | latin1_swedish_ci |

| wiki_page_props            | InnoDB | latin1_swedish_ci |

| wiki_category              | InnoDB | latin1_swedish_ci |

| wiki_change_tag            | InnoDB | binary            |

| wiki_revision              | InnoDB | latin1_swedish_ci |

| wiki_searchindex           | MyISAM | latin1_swedish_ci |

| wiki_archive               | InnoDB | latin1_swedish_ci |

| wiki_iwlinks               | InnoDB | binary            |

| wiki_sites                 | InnoDB | binary            |

| wiki_calendar_events       | MyISAM | latin1_swedish_ci |

| wiki_validate              | InnoDB | latin1_swedish_ci |

| wiki_comment               | InnoDB | binary            |

+----------------------------+--------+-------------------+

65 rows in set (0.005 sec)

80.146.191.156 (talkcontribs)

MariaDB [(none)]> SELECT column_name, character_set_name FROM information_schema.`COLUMNS`  WHERE table_schema = "<db>" AND table_name = "wiki_page";

+--------------------+--------------------+

| column_name        | character_set_name |

+--------------------+--------------------+

| page_id            | NULL               |

| page_namespace     | NULL               |

| page_title         | latin1             |

| page_restrictions  | NULL               |

| page_is_redirect   | NULL               |

| page_is_new        | NULL               |

| page_random        | NULL               |

| page_touched       | latin1             |

| page_latest        | NULL               |

| page_len           | NULL               |

| page_content_model | NULL               |

| page_links_updated | NULL               |

| page_lang          | NULL               |

+--------------------+--------------------+

13 rows in set (0.00 sec)

Bawolff (talkcontribs)

maybe try changing the charset on everything to binary? Mediawiki generally prefers the db to be binary (with data encoded utf8, but no charset in db). Make backups before trying anything.


Worst case, export a dump, convert with iconv, change charset to binary, reimport.

Reply to "Pages with special characters (ä,ö,ü) are not shown after upgrade from 1.31.14 -> 1.35.2"
Sokote zaman (talkcontribs)

Hello I installed the wiki from scratch and replaced the new 5GB photo folder The previous wiki is 1.35 with the current one Everything is fine but does not call photos Also, Special:ListFiles is nothing

Sokote zaman (talkcontribs)

I'm disappointed in your guidance. Is it permissible to take more than 1,000 photos from Wikiman and transfer it to The Destination Wiki? @Jonathan3

Bawolff (talkcontribs)

this is a free forum. You get what you get.

Jonathan3 (talkcontribs)

I don't know anything about Wikiman so don't know what's permissible.

I don't know enough about MediaWiki to work out your problem for sure from what you have said so far. I suspect it's just that MediaWiki doesn't know anything about the contents of your photo directory. If that's the problem then you could remedy it by bulk uploading the contents of the directory. Or if you are trying to recreate an old wiki then just follow the relevant instructions, which include transferring the wiki database as well as the files.

Sokote zaman (talkcontribs)

Thank you

You will explain more about this article please:

if you are trying to recreate an old wiki then just follow the relevant instructions, which include transferring the wiki database as well as the files.@Jonathan3

Jonathan3 (talkcontribs)

I recently moved my wiki to a new server and found these two articles helpful:

I will receive notifications from this topic without being pinged/tagged (whatever the word is) - and it might make other (better qualified) people feel more willing to reply too :-)

Jonathan3 (talkcontribs)

The wiki won't know about the files, unless you copy across the old database (as well as the wiki files) - or maybe Category:Bulk_upload will help.

This post was hidden by Jonathan3 (history)
Bawolff (talkcontribs)

use importImages.php.

Mediawiki needs to have imported the image metadata into db before it can see it. it wont recognize just a folder of images.

Reply to "Move the images folder"
Plastacikec (talkcontribs)

Hello, so I wanted to install the Scratch Wiki skin on my wiki, I loaded it using wfLoadSkin( 'ScratchWikiSkin2' ); but when I set it as a default skin and try to visit the wiki, it displays a 500 HTTPS error for some reason. Is there a way on how to fix this?

Bawolff (talkcontribs)

How to debug. Your php error log should have a more specific error.

Reply to "Scratch Wiki skin issue"

Trouble configuring the upload directory.

2
TheAutomaticc (talkcontribs)

I have sat here for hours trying to research this problem extensively and am back to square 1. I have followed the examples

on the previous pages to no avail.

I have an issue similar to the one I found from Adba.swht 4 years ago. (Unable to display file in Mediawiki)

The problem is that files upload are being created at the root folder for some reason.

Here is what i have in the Localsettings.php file.

$wgUploadDirectory = "$IP/images";

$wgUploadPath = "$wgScriptPath/images";

If I change it to $wgUploadPath = "/inetpub/wwwroot/mediawiki/images";

I get the following error message:

Action failed

Could not open lock file for "mwstore://local-backend/local-public/e/eb/ABCover.jpg". Make sure your upload directory is configured correctly and your web server has permission to write to that directory.

See https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:$wgUploadDirectory for more information.

I changed the upload path to $wgUploadDirectory = "/mediawiki2/images";

just to verify it is being created and sure enough at C:\mediawiki2\images

the files are created. ie. /f/ff/testimage.jpg

Its not that the files dont upload, its that when they do then

1. The file itself cannot be found

2. The thumbnail fails to render (Error creating thumbnail: File missing)

Also, the system temp folder keeps creating phpXXX.tmp files

this is probably related so I figured its worth mentioning.

As stated before I have tried several examples but nothing seems to work.

Any and all help would be GREATLY appreciated.

Thank you in advance.

Bawolff (talkcontribs)

probably something to do with windows acls.

Reply to "Trouble configuring the upload directory."

[SMW] Embedded queries are not auto updated

3
92.89.123.253 (talkcontribs)

Hello,

I am facing an issue with Semantic Mediawiki embedded queries {{#ask:...}} on my wiki with Mediawiki 1.35.1 and Semantic Mediawiki 3.2.3.

Queries are working fine but their displayed result are not automatically updated even when their *actual* results change (i.e. the retrieved data change as a result of some modifications on queried pages). I can force the update by purging the query page, but I have multiples queries accross my wiki and this is not a long term solution.

I have disabled all caching mechanisms (wgMainCacheType, smwgMainCacheType, smwgQueryResultCacheType) and non-default extensions, without any visible improvement.

Yet if I execute the SQL I get from {{#ask:...|format=debug}}, everything is fine. I don't know how to go further :(

Any idea on how I could fix this?

Jonathan3 (talkcontribs)
Bawolff (talkcontribs)

probably $wgParserCacheType more so than $wgMainCacheType. Parser cache type probably defaults to CACHE_DB when main cache type is set to CACHE_NONE.

That said, better to use Johnathan's suggestion and do it on a per page basis.

Reply to "[SMW] Embedded queries are not auto updated"