Page MenuHomePhabricator

Add certain templates and try to create a link on it results in link+template
Open, Needs TriagePublic

Description

Certain templates used to format content don't accept to have a link on it.

Steps to reproduce:

  1. Open VisualEditor on a page
  2. Type {{
  3. Write "Langue", and click "Ajouter un modèle" (well, I've used ctrl+enter)
  4. Write "en" for "Code de langue", and "Kraft Foods" for "Texte"
  5. Click "Insérer"
  6. Select the inserted template
  7. Press ctrl+K
  8. add link

Expectation: [[{{langue|en|Kraft Foods}}]]
Reality: [[Kraft Foods]]{{langue|en|Kraft Foods}}

Checked on Firefox and Chromium, last versions on ubuntu.

Event Timeline

The reproduction steps aren't clear to me, so I tried two methods.

Method 1:

  1. Open VisualEditor on a page
  2. Click "Insérer"
  3. Click "Modèle"
  4. Write "Langue", and click "Ajouter un modèle"
  5. Write "en" for "Code de langue", and "Kraft Foods" for "Texte"
  6. Click "Insérer"

Method 2:

  1. Copy [[{{langue|en|Kraft Foods}}]] from this task
  2. Open VisualEditor on a page
  3. Paste that text into the article.

Both methods correctly inserted [[{{langue|en|Kraft Foods}}]]; see the diffs from method 1 and method 2.

What method are you using to insert this template?

Yeah, steps are unclear because I haven't added the steps. Sorry. :/

  1. Open VisualEditor on a page
  2. Type {{
  3. Write "Langue", and click "Ajouter un modèle" (well, I've used ctrl+enter)
  4. Write "en" for "Code de langue", and "Kraft Foods" for "Texte"
  5. Click "Insérer"
  6. Select the inserted template
  7. Press ctrl+K
  8. add link

Ah, yes, I see it now. It's the process of trying to encapsulate the entire template into a link that does this.

Side note: aren't we supposed to have a double inspector for those cases, like this?

Capture d’écran_2017-11-15_14-15-23.png (239×352 px, 32 KB)

(It is a screenshot made by James a long time ago.)

@Jdforrester-WMF Do you happen to know why this dialogue doesn't seem to be showing now?

@Jdforrester-WMF Do you happen to know why this dialogue doesn't seem to be showing now?

Yeah, the stacked context menus do seem broken for annotated templates, only showing the node's context item and not the annotation – but they're still working for twice-annotated text (i.e. link and language, which are the only two "complex" annotations we have right now, the rest are "simple" and so don't display a context menu). Definitely a bug, though I couldn't swear for sure if it's ever worked.