Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11499 closed defect (fixed)

dijit._editor, LinkDialog broken with a custom scope name changed dojo.

Reported by: virsir Owned by: bill
Priority: high Milestone: 1.6
Component: Editor Version: 1.4.3
Keywords: multiversion scopename Cc:
Blocked By: Blocking:

Description

I am using a custom build dojo, and the dojo's scopeName has been changed, like "myDojo", "myDijit".

When I use RichText? editor and try to insert some links or images, it throws an error and the popup dialog can not used. I debugged it and found that is caused by the changed scopeName, "dojoType" would not be recognized in the plugin's template.

Attachments (2)

test_set.html (1.1 KB) - added by bill 9 years ago.
test case against release build, replaces dojo/tests/html/test_set.html
test_LinkDialog.html (1.8 KB) - added by bill 9 years ago.
test case for LinkDialog? against release build, replaces dijit/tests/editor/test_LinkDialog.html

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by bill

Hmm, _Templated does have code to handle that situation:

// Make sure dojoType is used for parsing widgets in template.
// The dojo.parser.query could be changed from multiversion support.
var parser = dojo.parser, qry, attr;
if(parser._query != "[dojoType]"){
	qry = parser._query;
	attr = parser._attrName;
	parser._query = "[dojoType]";
	parser._attrName = "dojoType";
}

// Store widgets that we need to start at a later point in time
var cw = (this._startupWidgets = dojo.parser.parse(node, {
	noStart: !this._earlyTemplatedStartup,
	inherited: {dir: this.dir, lang: this.lang}
}));

Please attach a (self contained) test case that reproduces the problem. Thanks.

comment:2 Changed 9 years ago by bill

Milestone: tbd1.6
Owner: set to bill
Status: newassigned

Oh, it's not _Templated that's failing, it's dojo.html (LinkDialog is doing a set("content", ...) on a ContentPane descendant).

I'll work on this.

comment:3 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [23251]) Multi-version support related fixes:

  • Add scope parameter to parser that controls which attribute names it searches for (dojoType vs. dojo16Type, data-dojo-props vs. data-dojo16-props, etc.) For back-compat defaults to dojo._scopeName although for 2.0 it should default to "dojo".
  • Fix bug where templates with data-dojo-type=... didn't work in multi-version pages. attrData was a true private variable and thus the attempts to modify it from outside the parser had no effect.
  • Change dojo.html to make parser search for dojoType / data-dojo-type even when multi-version support has renamed dojo to something else. Same as _Templated was already doing.
  • Update InlineEditBox template to parser 2.0 format.

Since multi-version support requires a build there are no tests checked in for this, but I did attach a test case to #11499.

Refs #11490, fixes #11499 !strict.

Changed 9 years ago by bill

Attachment: test_set.html added

test case against release build, replaces dojo/tests/html/test_set.html

Changed 9 years ago by bill

Attachment: test_LinkDialog.html added

test case for LinkDialog? against release build, replaces dijit/tests/editor/test_LinkDialog.html

comment:4 Changed 9 years ago by bill

(In [23300]) For backwards-compatibility in multi-version mode, especially for markup on the original page where a ContentPane based widget contains other widgets with (for example) dojo16Type attributes, make ContentPane tell the parser to use dojo._scopeName by default.

Adding parserScope parameter to ContentPane and dojo.html.ContentSetter to override this behavior and tell the parser search for dojoType / data-dojo-type regardless of dojo._scopeName.

Refs #11499 !strict.

Note: See TracTickets for help on using tickets.