In order to make $wgCategoryTreeMaxDepth work correctly, you have to do:
```
$wgExtensionFunctions[] = function () {The $wgCategoryTreeMaxDepth configuration variable for the [categorytree](https://www.mediawiki.org/wiki/Extension:CategoryTree) extension is using the wrong merge strategy (See https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#config ) in extension.json
For example, if you specify in LocalSettings.php
global $wgCategoryTreeMaxDepth;```lang="php"
$wgCategoryTreeMaxDepth = [0=> 5, 10 => 5, 20 => 5, 100 => 5];
};
```
Otherwise, it seems to getIt gets turned into (based on `var_dump($wgCategoryTreeMaxDepth)`):;` ):
```
array(7) {
[0]=>
int(1)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(5)
[4]=>
int(5)
[5]=>
int(5)
[6]=>
int(5)
}
```
Which is totally wrong.
I assume extension registration is using the wrong merge method and renaming index keys.different than what it should be, and as a result, the max depth is not actually changed since the array keys are messed up. Thus wikicode like `<categorytree depth="3">Root_category_name</categorytree>` only shows a depth of 1 and not 3. Instead we expect that if something like `[ 0 => 7 ]` is specified in LocalSettings.php, it overrides the `0` key, not that it gets added as a new key at the end of the array.
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