Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Page MenuHomePhabricator

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

Description

on https://www.mediawiki.org/wiki/Extension:Gadgets and edit throws following error:
TypeError: title is null
https://bits.wikimedia.org/static-1.24wmf9/resources/src/mediawiki/mediawiki.Title.js
Line 123


Version: unspecified
Severity: normal

Details

Reference
bz66724

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:18 AM
bzimport set Reference to bz66724.

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

|...

}}

Not sure if this a VE or Parsoid problem.

(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?

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

The Parsoid output looks correct to me.

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.

(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?

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 :)

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

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

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

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

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