Page MenuHomeMiraheze

Enable CustomSearchProfiles on rainversewiki
Open, NormalPublic

Description

Miraheze wiki URL:rainverse.miraheze.org
Wiki database name:rainversewiki

Extension Mediawiki page: https://www.mediawiki.org/wiki/Extension:CustomSearchProfiles
Extension git repository: https://git.average.name/BlankEclair/CustomSearchProfiles

Configuration settings for the extension on rainversewiki:

$wgCustomSearchProfilesProfiles = [
    'comic' => [
        'namespaces' => [
            3002, // Rain
            3004, // MIS
            3006, // Rainbow
        ],
    ],
    'mainspace' => [
        'namespaces' => [ NS_MAIN ],
    ],
];

Event Timeline

Since this seems to be a fairly simple extension configuration format with a simple use case, it would likely be more effective to add the setting to ManageWiki/settings if possible. I'll look into it now and add if possible once it's approved and I add the extension to ManageWiki/extensions.

Yes please! I couldn't figure out how to configure ManageWiki's settings page in a way to let it set the configuration variable like that (though I only skimmed through ManageWikiSettings.php)

I looked through the file myself and in addition to there being no option to select from a list of namespaces(the wikibase settings seem to just take ints) I'm not actually sure if ManageWiki supports this kind of complex configuration. I've asked in #miraheze-tech on IRC/#tech on Discord to see if anyone else knows a way but it's tricky(feel free to join and keep an eye on, or I'll leave a comment here if anyone provides useful insight). It may be possible to expand ManageWiki to support this, but frankly, I'm not familiar with its codebase at this time and am fairly abysmal at PHP, in addition to being swamped for the next week-ish due to academic obligations. If there's no other solution we may have to look into this. For the time being a manual entry will suffice likely.

ManageWiki cannot support this kind of configuration, it can only support simple arrays in the form ['first', 'second', 'third']. It cannot handle nested arrays.

Shame, so excluding a change to the current extension itself which would likely be horribly hacky given limitations or expanding ManageWiki’s functionality(no idea how plausible that would be) the extension will need to be manually configured, which would likely warrant some sort of notice when enabling it. You may be able to do something of the sort of having $wgCustomSearchProfileRigidName = "Name here" and $wgCustomSearchProfileRigidNamespaces = [NS_MAIN…] as an alternative config method but even for me that’s bodged

The issue is not inherently that ManageWiki cannot support nested arrays, its that it relies heavily on OOUI, which is a rather limiting decision. There is no array/json editor for OOUI, only a tag/multiselect which is then translated into an array. Having this functionality would require a front-end change with some kind of module that allows for editing JSON (similar to the JSON editor I implemented and showed in Discord a few weeks ago).

The change would have to be done in LocalWiki.php, which is not a big deal if the config doesn't change often, but could get quite annoying if it is intended to change regularly (although I'm not sure why it would.)

Theoretically, the configuration for this extension could be done like Special:ManageWiki/{namespaces,permissions}, or it could be hardcoded in ManageWiki/extensions.
In practice, that's a lot of extension-specific work for an extension that I couldn't find others having any interest in (since I had to write it myself). It's probably fine to not have it be configurable in ManageWiki.

Redmin removed Redmin as the assignee of this task.Mon, Jun 10, 15:24
Redmin moved this task from Security Review Needed to Reviewed, Approved on the Extensions board.
Redmin subscribed.