Page MenuHomePhabricator

Improve incomplete TemplateData support in non-template namespaces
Open, Needs TriagePublicFeature

Description

Original task description: Currently, TemplateData doesn't appear to work in the user namespace. Although you can use the add template gui to add templates from user pages, it always says that the page is missing TemplateData. There is also no "Manage TemplateData" button on user pages with TemplateData. If this could be added that would be greatly appreciated. Thanks.

To do:

Event Timeline

Levi_OP renamed this task from Add support for user namespace to Add TemplateData support for user namespace.Feb 1 2022, 8:34 PM
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 1 2022, 10:00 PM

@Levi_OP: Thanks for reporting this. For future reference, please use the feature request form (linked from the top of the task creation page) to create feature requests. Thanks.

@Aklapper the link at [[mw:Help:TemplateData#Limitations and feedback]] saying that it is for requesting new features links straight to here. I was looking for something else but assumed this was the place I was supposed to go. Should this be changed?

@Levi_OP: Hah, thanks! :) Thiemo was kind enough to fix that.

in the user namespace […] it always says that the page is missing TemplateData.

I just tried this on English Wikipedia and it mostly works. There are only a few limitations:

  • I have to type (or better copy and paste) the full name of the user page, including the "User:" prefix. The suggester is intentionally limited to the "Template:" namespace and won't verify anything else. But I can still press enter. The template documentation is found in both VisualEditor and MediaWiki-extensions-TemplateWizard.
  • The MediaWiki-extensions-TemplateWizard currently strips the "User:" prefix and creates partly broken wikitext because of this. This should be fixed. A workaround is to manually add the "User:" prefix to the wikitext.
  • The button intentionally doesn't appear on non-template pages. This would be confusing. A compromise I can think of is to show the button on non-template pages when there is already a <templatedata> section. I think it's possible to do this server-side without adding unnecessary scripts to pages that don't need it.

@Levi_OP, can you provide more information or more detailed steps to reproduce the issue?

Change 790644 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/TemplateWizard@master] Fix partial support for templates outside of Template: namespace

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

@thiemowmde This issue seems to have been fixed since I last looked at this. I specifically remember copying the User: namespace prefix into the "Insert a template" dialog, and it just didn't used to work. Something seems to have fixed it since then. As you mentioned, though, the templatedata gui editor still doesn't appear in anything but the template namespace. The fix you suggested is what I was thinking, and should work. Thanks!

@Levi_OP, does this mean what you tried to do on February 1st now behaves different? I'm curious what changed. When I go back in time it looks like it should have worked back then.

@thiemowmde It's possible that I was doing something wrong at the time, but as I described in my original post, it kept saying the page was "missing TemplateData", and I'm fairly certain I tried it with User: at the beginning. It works now though, so I don't know.

Ok, sounds good. Thanks a lot for your help!

thiemowmde renamed this task from Add TemplateData support for user namespace to Improve incomplete TemplateData support in non-template namespaces.May 11 2022, 6:49 AM
thiemowmde added a project: patch-welcome.
thiemowmde updated the task description. (Show Details)

Change 790644 merged by jenkins-bot:

[mediawiki/extensions/TemplateWizard@master] Fix partial support for templates outside of Template: namespace

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

Change 950794 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Krinkle):

[mediawiki/extensions/TemplateData@master] Load GUI on action=edit if page has templatedata even outside NS_TEMPLATE

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

Change 950794 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Load GUI on action=edit if page has templatedata even outside NS_TEMPLATE

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