Page MenuHomePhabricator

$wgDefaultUserOptions['editsection'] = 0 does not work
Closed, ResolvedPublic

Description

Author: h-j.luecking

Description:
MediaWiki 1.71
Function initialiseFromUser( &$userInput ) {
Line 4591

$this->mEditSection = true;

meaning imho that by default the possibility to edit section is set to
true. I think this is a reason why in LocalSettings.php

$wgDefaultUserOptions['editsection'] = 0

does'nt work (It did not in my wiki).

In MediaWiki 1.46 you can find the line.

$this->mEditSection = $user->getOption( 'editsection' );

Here the possibility to edit section is defined by LocalSettings.php.

I used this lines for my purpose

if ($user->getID()) {
   $this->mEditSection = $user->getOption( 'editsection' );
} else {
   $this->mEditSection = 0;
}

by Zigger, from (http):
mail.wikipedia.org/pipermail/mediawiki-l/2004-November/002099.html

HeinzJ


Version: 1.7.x
Severity: normal

Details

Reference
bz7526

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:23 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz7526.
bzimport added a subscriber: Unknown Object (MLST).

dto wrote:

By the way, this does not affect 1.8, AFAIK.

$wgDefaultUserOptions appears to be used anywhere by MediaWiki, which
would explain why it doesn't work. :)

Fixed in r16884.

dto wrote:

Sweet, I don't need to use an extension function to set defaults any more (since
the advertised UserDefaultOptions hook didn't exist either o_O).