Wikimedia

Fix merge method used for $wgCategoryTreeMaxDepth in CategoryTree extension for MediaWiki

The $wgCategoryTreeMaxDepth configuration variable for the categorytree extension is using the wrong merge strategy (See https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#config ) in extension.json

Basically, if a user specifies $wgCategoryMaxDepth = [ 10 => 4 ]; in LocalSettings.php, MediaWiki is adding the key 4 to the end of the array of default values, where instead it should be overwriting the default value for the array key named 10, not adding a new key.

Prerequisites for this task:

  • You have installed MediaWiki locally
  • You are familiar with how to submit a patch to gerrit.

Your task is to modify the extension.json file in categorytree to use the array_plus merge method for the $wgCategoryTreeMaxDepth config variable. See https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#config for documentation on the config fields of extension.json and how to specify merge methods (Keeping in mind that CategoryTree uses version 1 of the extension manifest format)

Once you have modified the file, test that setting $wgCategoryTreeMaxDepth in LocalSettings.php can correctly override the default setting. Then submit a patch to gerrit with an appropriate commit message

Task tags

  • mediawiki
  • json
  • php

Students who completed this task

pppery

Task type

  • code Code
close

2019