Page MenuHomePhabricator

When a template that outputs a list is followed by a template without visible output at the end of a page, categories become unavailable in Visual Editor
Open, Needs TriagePublicBUG REPORT

Description

Like the title says.

Steps to replicate the issue (include links if applicable):

  • Create a template with the following content:

Template:List output

* This is
* A list
  • Create a second template with the following content:

Template:Empty output

[[Category:This is my unique category name]]
  • Create a page with the following content:
{{List output}}

{{Empty output}}

[[Category:My test category]]

Sandbox link replicating this: https://en.wikipedia.org/w/index.php?title=User:Jon_Harald_S%C3%B8by/sandbox&oldid=1123212798

  • After saving or previewing, switch to the visual editor.

What happens?:

  • When editing in the visual editor, no categories are visible at the bottom of the screen.
  • Additionally, when you click the hamburger icon and then "Categories", no categories are there. You can add new ones, but the existing category ("My test category") is not in the list so you can remove it or change its sortkey.
  • Also, the template with the empty output (a category in this case) is not available for manipulation from Visual Editor at all. There is no placeholder for it.

What should have happened instead?:

  • Categories should be visible and editable
  • The template with the invisible output should have a placeholder so it can be manipulated or removed

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Original description

Steps to replicate the issue (include links if applicable):

What happens?:

  • No categories are visible at the bottom of the page in edit mode, like they normally are
  • Additionally, you can't edit any categories when you go to the category edit menu (hamburger icon » Categories)

What should have happened instead?:

  • Categories should be visible and editable

Event Timeline

It seems that the problem appears when the template {{filmlenker}} is followed by {{autoritetsdata}} (even with intermediate line breaks) and {{autoritetsdata}} outputs empty content (or only a category, in this case). If you enter some text between them, the categories show up again. Additionally, the {{autoritetsdata}} template is not displayed in VE at all when it is empty.

Interesting, there could be an unclosed tag or something in one of the templates, causing it to swallow the categories and make them invisible to the visual editor.

That's what I suspected too, but I looked for a long time without finding anything. I was able to replicate the issue in my sandbox in enwiki, I will update the task to reflect what I've found.

jhsoby renamed this task from Categories intermittently not shown in visual editor on no.wikipedia to When a template that outputs a list is followed by a template without visible output at the end of a page, categories become unavailable in Visual Editor.Tue, Nov 22, 3:58 PM
jhsoby updated the task description. (Show Details)