Project:Support desk

Jump to navigation Jump to search

About this board

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

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • 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".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文

Upgrade v.1.9.3 to current 1.33 - ::insert() needs a positive user ID.

4
Elgekf (talkcontribs)

Still trying to get a pretty old instalation of mediawiki 1.9.3 to the current version.

Successfully managed to repair a lot of wrong encodings, also converted all MyISAM to InnoDB - my first try is described in this post: https://www.mediawiki.org/w/index.php?title=Topic:V8fuqe8wd9q6w8wl&topic_showPostId=v8z0t80qsuhdatt7&fromnotif=1&markasread=1017963&markasreadwiki=mediawikiwiki#flow-post-v8z0t80qsuhdatt7

Thanks to all who made suggestions there - I finally followed the hint from Bawolff to convert the tables to InnoDB and also needed to create a table valid_tag. I finally run into this error: ... Checking existence of old default messages...[3a70e6878cc1e7a26a4b3333] [no req] UnexpectedValueException from line 169 of /data/localweb/www/wikin/includes/user/UserGroupMembership.php: UserGroupMembership::insert() needs a positive user ID. Did you forget to add your User object to the database before calling addGroup()? Backtrace:

  1. 0 /data/localweb/www/wikin/includes/user/User.php(3744): UserGroupMembership->insert(boolean)
  2. 1 /data/localweb/www/wikin/maintenance/deleteDefaultMessages.php(83): User->addGroup(string)
  3. 2 /data/localweb/www/wikin/maintenance/update.php(215): DeleteDefaultMessages->execute()
  4. 3 /data/localweb/www/wikin/maintenance/doMaintenance.php(96): UpdateMediaWiki->execute()
  5. 4 /data/localweb/www/wikin/maintenance/update.php(266): require_once(string)
  6. 5 {main}

the source referenced at #1 reads

$user->addGroup( 'bot' ); $wgUser = $user;

I already tried to omit the line $user-addGroup( 'bot '); - this lets the upgrade process finish successfully. But the History of changes is full of Changes made by the Upgrade process and they can not be filtered - probably due to the attribute 'bot' is not set for the user used to do the changes. I'd prefer to be able to filter these changes and leave the line in place.

Does anyone have an idea of how get around this problem?

B.T.W. Do you think that the script created to do this specific upgrade would be of any use for someone else? if so I will publish it here.

tia elgekf

Bawolff (talkcontribs)

This seems to be caused by the actor migration. "MediaWiki default" isn't a valid user anymore, so the script cannot add a bot flag to it. The most obvious solution would be to change User::newFromName to User::newSystemUser, but that doesn't work either as there is already a conflicting "anonoymous" actor with that name.

Filed at: https://phabricator.wikimedia.org/T236444

Elgekf (talkcontribs)

Thanks a lot for your assistance. Do you think it might be viable to create a user "Mediawiki default" before starting the update? I do all this on a copy, not the real machine.

Bawolff (talkcontribs)

you probably have it as a pseudo user from creating the main page from install. And its in wgReservedUsernames preventing its general use, but otherwise yes-if you have a real user (i.e. actor.actor_user points to its correct entry in user table) by that name the issue would be fixed

Reply to "Upgrade v.1.9.3 to current 1.33 - ::insert() needs a positive user ID."
Summary by AhmadF.Cheema

Empty $wgGroupPermissions = array ();.

Michael.a.hall4 (talkcontribs)

I just built an internal mediawiki site. I can no longer edit the sidebar and make changes to it. Please advise what I may be doing wrong here. I'm an admin, beauracrat, sysop bot and automatic user. Yet can't add or edit the Navigation Sidebar and no edit comes up in the screen to edit.

Any help on this would be great. Thank you.

Michael.a.hall4 (talkcontribs)

Ok I found out the issue. It took me a bit on this one. The LocalSettings.php file had a line called $wgGroupPermissions = array ();

It was added in from another user stating this was needed to set users into an array and then you can added specific users to said array and then lock down said user array..


This was causing the admins not to be able to edit the sidebar. Once removed it worked like a charm... Now I can edit...

Fatal error with Extension:PageNotice

2
2610S (talkcontribs)

Installing this Extension bring to a Fatal error

Fatal error: Uncaught Exception: /homepages/32/XXXXX/htdocs/TEST/mediawiki-1.32.0/extensions/PageNotice/extension.json does not exist! in /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/includes/registration/ExtensionRegistry.php:107 Stack trace: #0 /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/includes/GlobalFunctions.php(50): ExtensionRegistry->queue('/homepages/32/d...') #1 /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/LocalSettings.php(189): wfLoadExtension('PageNotice') #2 /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/includes/Setup.php(103): require_once('/homepages/32/d...') #3 /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/includes/WebStart.php(77): require_once('/homepages/32/d...') #4 /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/index.php(39): require('/homepages/32/d...') #5 {main} thrown in /homepages/32/XXXX/htdocs/TEST/mediawiki-1.32.0/includes/registration/ExtensionRegistry.php on line 107

Ciencia Al Poder (talkcontribs)

I've updated Extension:PageNotice installation instructions. you need to use require_once instead of wfLoadExtension

Reply to "Fatal error with Extension:PageNotice"

Cannot access special character pages if logged in

4
223.255.183.90 (talkcontribs)

For some reason I find I am not able to view a page with special characters if I am logged in. It doesn't seem to make a difference what browser I am using, I've tried Firefox, Chrome, iexplorer, phone, iPad, desktop ... let's take a simple example: http://www.finnegansweb.com/wiki/index.php/Past_Eve_and_Adam%27s ... perfectly fine if viewed without logging in, but if logged in, inaccessible. Any ideas on what the problem is? Can this be fixed?

Bawolff (talkcontribs)

what precisely happens? Blank page?

Is there anything in php error log?

Jonathan3 (talkcontribs)

If it helps, I created an account and the error I get is:

This page isn’t working

www.finnegansweb.com redirected you too many times.

Try clearing your cookies.

ERR_TOO_MANY_REDIRECTS

If you search the internet for "mediawiki too many redirects" some potentially useful pages come up.

This post was hidden by 171.5.178.214 (history)
Reply to "Cannot access special character pages if logged in"

max-width in Vector skin to control site layout width

15
111.69.202.141 (talkcontribs)

It's one of the dumber design aspects of MediaWiki and Wikipedia and their skins that the site fills 100% of the screen width, regardless of resolution, leading to a ridiculous appearance on high resolution monitors.

Short of a grid layout or other sophisticated approaches, what is required is a sensible max-width for the entire site layout, in the order of 1000 - 1300 px I suggest, allowing the site to scale horizontally below that but freeze on decent res screens.

I had a bunch of CSS modifications for Monobook that worked well, but they made use of the #globalWrapper which is not present in Vector. I am trying to migrate my old Monobook styling across to Vector.

I played around with adding styles to the various page elements in Vector, and even the <body> tag, but ended up frustrated trying to get the header and sidebar elements to cooperate.

Has anyone worked out some CSS for Vector that does the trick?

MarkAHershberger (talkcontribs)

This is as close as I can get:

/* upper blue line */
#mw-head-base {
	margin-left: auto !important;
	margin-right: auto !important;
  max-width: 1000px !important;
}
/* lower blue line + footer content */
#footer {
	margin-left: auto !important;
	margin-right: auto !important;
  max-width: 1000px !important;
}
/* main content */
#content {
	margin-left: auto !important;
	margin-right: auto !important;
  max-width: 1000px;
}
111.69.202.141 (talkcontribs)

Yep I got about as far myself.

  1. mw-page-base can be styled similarly but the page tabs, personal links, and the sidebar (which would now float over top of the content on lower resolutions) stump me.
MarkAHershberger (talkcontribs)

Just came up with something I like a little better:

/* upper blue line */
#mw-head-base {
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 1000px !important;
}
/* lower blue line + footer content */
#footer {
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 1000px !important;
}
/* main content */
#content {
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 1000px;
}
#bodyContent {
	z-index: 10;
}
#mw-navigation {
	margin-right: auto !important;
	max-width: 1190px;
        min-width: 1000px;
	position: absolute;
	top: 0;
        left: 50%;
        margin-left: -500px;
}
div#mw-panel {
	position: relative;
	left: 0;
	margin-left: -190px;
        width:160px;
}
div#mw-head {
	position: relative;
        right: 0;
        margin-right: 0;
        max-width: 1000px;
}
This post was hidden by 31.31.187.156 (history)
MarkAHershberger (talkcontribs)

I don't have time to do more now. And I still don't understand why you don't adjust your window to make it look better. But maybe someone else can offer more help.

74.91.102.250 (talkcontribs)

For me, I want to do this because my browser window has other tabs that conform to modern browsing standards, so I don't want to resize my window every time I switch to or from a wikipedia tab.

If someone is able to help, I think I almost have it, on a very vanilla vector-skinned site: http://www.aerenamasters.com/wiki/index.php?title=MediaWiki:Common.css

I can't figure out how to make the navigation behave well:

/* working ... */
#content{
        margin-left:auto !important;
        margin-right:auto;
	max-width: 950px;
}

#footer {
	margin-left: auto !important;
	margin-right: auto;
	max-width: 950px;
}

/* testing */
#mw-navigation {
        margin-left: auto !important;
	margin-right: auto;
	max-width: 1140px;
        top: 0;
}

Thanks for any help!

MarkAHershberger (talkcontribs)

For anyone who wants to try this but doesn't know how, you need to put it on your common.css page.

Spas.Z.Spasov (talkcontribs)

For Vector skin put next lines into MediaWiki:Vector.css or into your custom vector.css.

    /* set max width and fix the background */
    html,
    body {
    	position: relative;
    	margin-left: auto !important;
    	margin-right: auto !important;
    	max-width: 1280px;
        background-position: top left;
        background-repeat: repeat-x;
    	background-size: 100% 5em;
        background-image: url(/skins/Vector/images/page-fade.png);
        background-color: #f6f6f6;
        background-image: -webkit-gradient(linear,left top,left bottom,color-stop(50%,#ffffff),color-stop(100%,#f6f6f6));
        background-image: -webkit-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
        background-image: -moz-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
        background-image: linear-gradient(#ffffff 50%,#f6f6f6 100%);
    }
    
    /* set blue right border */
    .mw-body { border-right: 1px solid #A7D7F9; }
    
    /** fix the position of:
    			personal user menu
    			search bar
    			the pop-up indicator of language selector
    			search suggestions 
    **/
    #p-personal { right: 3pt; }
    #p-search { margin-right: 3pt; }
    .imeselector { position: fixed; }
    .suggestions { right: 3pt !important; }

If you want to apply this CSS for the restricted pages, write down next line into your `LocalSettings.php`, but first check this comment:

    $wgAllowSiteCSSOnRestrictedPages = true;
88.145.181.85 (talkcontribs)

Thank you so much! Exactly what I was looking for.

Spas.Z.Spasov (talkcontribs)

The problem that I can not solve completely is the behaviour of some pop ups as these of Extension:Popups.

Varlin (talkcontribs)
Varlin (talkcontribs)

Spas.Z.Spasov's CSS causes some offset problems (with Extension:Popups, with some unfolding combobox and with some dialogs). This alternative option seems to cause less offsets.

/* set max width and fix the background, see skinVector.patch */
#wikirouge-bodycontent-wrapper {
	position: relative;
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 1100px;
}

    html,
    body {
        background-position: top left;
        background-repeat: repeat-x;
    	background-size: 100% 5em;
        background-image: url(/skins/Vector/images/page-fade.png);
        background-color: #f6f6f6;
        background-image: -webkit-gradient(linear,left top,left bottom,color-stop(50%,#ffffff),color-stop(100%,#f6f6f6));
        background-image: -webkit-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
        background-image: -moz-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
        background-image: linear-gradient(#ffffff 50%,#f6f6f6 100%);
    }
    
    /** fix the position of:
    			personal user menu
    			search bar
    			the pop-up indicator of language selector
    			search suggestions 
    **/
    #p-personal { right: 3pt; }
    #p-search { margin-right: 3pt; }
    .imeselector { position: fixed; }
    .suggestions { right: 3pt !important; }

But it needs to be combined with this patch :

--- skins/Vector/includes/templates/index.mustache (date 1571250157017)
+++ skins/Vector/includes/templates/index.mustache (date 1571250157017)
@@ -1,4 +1,5 @@
{{{html-headelement}}}
+<div id="wikirouge-bodycontent-wrapper">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body" role="main">
@@ -32,5 +33,6 @@
{{! html-unported outputs <div id="mw-navigation"> and <div id="footer"> }}
{{{html-unported}}}
{{{html-printtail}}}
+</div>
</body>
</html>
Vishkujo (talkcontribs)

How do you use the patch? (Or where do you put it?)

Thanks.

Varlin (talkcontribs)

You have to edit this file

skins/Vector/includes/templates/index.mustache

And add the lines marked with a " + " (here, just a div tag) at the right place.

(This syntax enables you to make it automatically using some tools)

Reply to "max-width in Vector skin to control site layout width"
FrugalTPH (talkcontribs)

How would I go about controlling the behaviour of the enter key, when pressed when a form field has focus?

The default appears to be that it submits the whole form, regardless of which input box currently has focus. There are some cases where I'd like it to insert a new line break, and others where I'd like it to execute a particular button on the same form, that is associated with / relevant to the field which has focus.

Any help / suggestions would be much appreciated. Thanks.

Jonathan3 (talkcontribs)

There is interesting stuff here.

I don’t think this is a mediawiki-specific thing.

If you add JavaScript/jquery to your form you could put your form in a widget (Extension:Widgets).

Bawolff (talkcontribs)

The best approach is to use a <textarea> input when you want enter to make a newline.

Reply to "Form field enter key behaviour"

My IP was block . i don't know Why?

2
Summary by Bawolff

Ask english wikipedia folks about english wikipedia blocks

110.54.134.117 (talkcontribs)

my IP address was block from indian individual that why i can't create account in wikipedia How to solve this Challenge guys?? any idea why they block me? i appreciate your responds guys. thanks

Bawolff (talkcontribs)

How create centralauth database in SQLite

3
2804:431:D700:5917:78A9:A7CC:4AFD:D279 (talkcontribs)

Hello,i would like of the know,how create the centralauth database in SQLite?What's the code?My wiki is version 1.33.0

Malyacko (talkcontribs)
Bawolff (talkcontribs)

The create the centralauth db step is optional. You can use one of your existing databases instead, just change $wgCentralAuthDatabase to be appropriate.

Reply to "How create centralauth database in SQLite"
Fitzmichael (talkcontribs)

I'm pretty good at using ref. works but I'm foxed by your word frequency pages and the links they point to. None but the smaller lists show what the frequency (or rank) figure refers to; I had expected a %, not something that seemed to require that I know the total in that corpus, from which % could be calculated. I can't be alone in wanting something from which I can quickly assess how likely it is that one word rather than another might be understood not just recognised by a reader. Could an editor consider this?

This, that and the other (talkcontribs)

Hi, I'm afraid you have landed in the wrong place. This page is for help with MediaWiki, a popular wiki software package. If you can provide a link to the word frequency lists you are referring to, we might be able to point you in the right direction and suggest who is the best person to ask your question.

Visual differences between page preview & page

5
FrugalTPH (talkcontribs)

I've been trying to use the clickable button template, and all appears to work / render successfully when I preview the page. However, after I've clicked submit the real page just shows the content as a standard hyperlink (no custom CSS button formatting like was working in the preview).

Does anyone know why this could be?

Bawolff (talkcontribs)

are you using ooui buttons? The script might not load on normal page views but on previews. I think some people add gadgets or stuff to mediawiki:common.js for that

FrugalTPH (talkcontribs)

I have the TemplateStyles extension installed, but I don't recall ever installing OOUI. I am using mw v1.31.1 with the vector skin, and I've exported the Clickable Button template from here & imported that into my own wiki.

FrugalTPH (talkcontribs)
Bawolff (talkcontribs)

the template from commons depends on the following snippet from commons:mediawiki:common.js

/**
 * jQuery UI loader
 * Loads jQuery UI modules on demand and allows users making use of
 * (some) of the awesome jQuery UI widgets.
 * 
 * @maintainer [[User:Rillke]]
 */
mw.hook( 'wikipage.content' ).add( function ( $content ) {
 var $accordion = $content.find( '.accordion' ),
  $button = $content.find( '.ui-button' );

 if ($accordion.length) {
  mw.loader.using( 'jquery.ui.accordion', function () {
   $accordion.accordion( { autoHeight: false } );
  } );
 }
 if ($button.length) {
  mw.loader.load( 'jquery.ui.button' );
 }
} );

You should include it on the page named MediaWiki:Common.js on your wiki