Page MenuHomePhabricator

It is not possible to save community configuration at wikis where GEInfoboxTemplates was defined
Closed, ResolvedPublic

Description

Earlier today, I wanted to use community configuration in my cswiki admin hat. However, the system complained that "There are problems with some of your input." (even when submitting without actually changing anything).

The error message down in the form is <pagename> is not in the "Template" namespace.. It appears that Special:EditGrowthConfig considers pages listed in GEInfoboxTemplates to be in the article namespace (as no namespace is defined) and refuses to save, as they should be in the template namespace instead.

As far as I can see, the add an image code should be able to handle both variants (both with namespace omitted and explicitly specified). So IMO, the fix can just be "specify namespace explicitly".

@Tgr, since GEInfoboxTemplates was added to the on-wiki config files by you, do you have an opinion on this?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr triaged this task as High priority.Dec 31 2021, 10:14 PM
Tgr edited projects, added Growth-Team (Sprint 0 (Growth Team)); removed Growth-Team.

Some of the pages are not and should not be in the template namespace - e.g. the cswiki list includes Modul:Infobox. Did the actual configuration also break, or just the validation process?

Some of the pages are not and should not be in the template namespace - e.g. the cswiki list includes Modul:Infobox. Did the actual configuration also break, or just the validation process?

I didn't check behavior of the actual code that handles the variable. Rest of the config definitely works (we'd notice quickly if it stopped, I think).

I'm not sure Modul:Infobox needs to be included (it's loaded by Template:Infobox, which in turn is called by the majority of infobox templates). If we want to support non-templates listed in this variable, https://github.com/wikimedia/mediawiki-extensions-GrowthExperiments/blob/master/includes/Specials/SpecialEditGrowthConfig.php#L370 (and few following lines) should get removed.

I can think of three options:

  1. limit GEInfoboxTemplates to pages in the Template namespace
  2. add functionality to HTMLTitleTextField to specify a default namespace while allowing other namespaces
  3. require full page names in GEInfoboxTemplates

The reason module support was added is that we want to keep the template lists in the low hundreds, wikis can easily have more infobox templates than that, many of them are generated via Lua, and there is no guarantee they use a wrapper template like Template:Infobox on cswiki which could be used instead of the module for search. (I ran into problems on arwiki I think when using only templates, although it is entirely possible that I made some mistake.) So I think option 1 is risky.

Option 2 looks like confusing UX because how do you differentiate pages in the default namespace from pages in the main namespace? (Which is not something we'd run into, but if the functionality is added to core, it should be considered.)

So yeah, I think just update the on-wiki config and remove namespace special casing from the code.

...but then, it seems rather confusing to have various fields called SomethingTemplates but some of them need to be prefixed and some not. Ugh.

I think we should go with option 3, as it matches what I decided to do with the other fields that normally use templates (namely templates for template-based newcomer tasks).

I think we should go with option 3, as it matches what I decided to do with the other fields that normally use templates (namely templates for template-based newcomer tasks).

That seems reasonable to me.

Change 769465 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] SpecialEditGrowthConfig: Do not require GEInfoboxTemplates to be templates

https://gerrit.wikimedia.org/r/769465

Patch is +2'ed, so moving back to in progress for us to update on-wiki config after this change is in group2 with the next train. Then we could also have a patch to remove the default NS_TEMPLATE namespace in TemplateCollectionFeature.

Change 769465 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] SpecialEditGrowthConfig: Do not require GEInfoboxTemplates to be templates

https://gerrit.wikimedia.org/r/769465

Change 770131 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] TemplateCollectionFeature: Do not default to NS_TEMPLATE

https://gerrit.wikimedia.org/r/770131

Patch is +2'ed, so moving back to in progress for us to update on-wiki config after this change is in group2 with the next train. Then we could also have a patch to remove the default NS_TEMPLATE namespace in TemplateCollectionFeature.

Set a reminder for this Thursday to have a look at that.

Patch is +2'ed, so moving back to in progress for us to update on-wiki config after this change is in group2 with the next train. Then we could also have a patch to remove the default NS_TEMPLATE namespace in TemplateCollectionFeature.

Set a reminder for this Thursday to have a look at that.

Train's not on group2 yet (in fact, it's only at group0 due to blockers). Postponing reminder to have a look next week.

Change 770131 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] TemplateCollectionFeature: Do not default to NS_TEMPLATE

https://gerrit.wikimedia.org/r/770131

Patch is +2'ed, so moving back to in progress for us to update on-wiki config after this change is in group2 with the next train. Then we could also have a patch to remove the default NS_TEMPLATE namespace in TemplateCollectionFeature.

Set a reminder for this Thursday to have a look at that.

Train's not on group2 yet (in fact, it's only at group0 due to blockers). Postponing reminder to have a look next week.

@Urbanecm_WMF - are you still planning to take a look? I checked testwiki wmf.5 (all patches have been deployed) and all seem to be working as expected.

[...]
@Urbanecm_WMF - are you still planning to take a look? I checked testwiki wmf.5 (all patches have been deployed) and all seem to be working as expected.

Hello, I did have a look, but apparently I didn't update the task. Sorry for that. Special:EditGrowthConfig works fine at all add an image wikis. Closing as Resolved.