VisualEditor: Template dialog throws error when target is a wikitext expression
Closed, ResolvedPublic

bzimport set Reference to bz66724.
AzaToth created this task.Via LegacyJun 17 2014, 3:06 PM
Esanders added a comment.Via ConduitJun 18 2014, 11:44 AM

Looks like we don't support evaluated template names:
{{ {{TNTN:Extension}}

|...

}}

Not sure if this a VE or Parsoid problem.

Jdforrester-WMF added a comment.Via ConduitJun 19 2014, 12:54 AM

(In reply to Ed Sanders from comment #1)

Looks like we don't support evaluated template names:
{{ {{TNTN:Extension}}

|...

}}

Not sure if this a VE or Parsoid problem.

Feels like this template should have been ExpandedAttrs'ed by Parsoid?

GWicke added a comment.Via ConduitJun 19 2014, 1:00 AM

Simple test case: {{{{echo|echo}}|foo}}

The Parsoid output looks correct to me.

GWicke added a comment.Via ConduitJun 19 2014, 1:05 AM

Hmm, actually there is an issue in the Parsoid output for this test case, but it's not likely to be related to this bug.

{{{{echo|echo}}|foo}}

data-mw looks good, but the string 'foo' is missing in the span for some reason.

<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"{{echo|echo}}"},"params":{"1":{"wt":"foo"}},"i":0}}]}'></span>

Reported in bug 66820.

Jdforrester-WMF added a comment.Via ConduitJun 19 2014, 1:19 AM

(In reply to Gabriel Wicke from comment #3)

Simple test case: {{{{echo|echo}}|foo}}

The Parsoid output looks correct to me.

Thanks!

Ed – I guess in these cases we should just detect that it's an invalid title somehow and mark the template as uneditable?

Florian added a comment.Via ConduitJul 5 2014, 1:14 PM

I wanted to open a new bug, but here is still one :) Actually i become the message:
Uncaught TypeError: Cannot read property 'replace' of null

fyi :)

Krinkle added a comment.Via ConduitJul 9 2014, 7:48 PM

Yep. It used to throw

Uncaught TypeError: title is null

It now fails earlier because the code changed. Namely on

Uncaught TypeError: Cannot read property 'replace' of null

gerritbot added a comment.Via ConduitJul 9 2014, 8:09 PM

Change 145055 had a related patch set uploaded by Krinkle:
MWTemplatePage: Account for template.title being null

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

gerritbot added a comment.Via ConduitJul 10 2014, 1:59 PM

Change 145055 merged by jenkins-bot:
MWTemplatePage: Account for template.title being null

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

Add Comment