Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#11493 closed defect (fixed)

[regression] TextBox: possibility of "this.templateString is null" on custom dijit.form.TextBox extensions upgrading from 1.3 to 1.5

Reported by: Kenneth G. Franqueiro Owned by: Douglas Hays
Priority: high Milestone: 1.5.1
Component: Dijit - Form Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

Developers upgrading from 1.3 to 1.4+ may experience an exception on any custom dojo.declared extensions of dijit.form.TextBox (or its subclasses such as ValidationTextBox), due to code that likely changed with the deprecation of templatePath.

If a custom class declared based on TextBox has overridden its templateString and set it to null (presumably to force templatePath to take precedence), an exception will occur due to TextBox's postMixInProperties method referencing templateString with the assumption it is defined.

An example is attached; it might be easier to understand from there.

Obviously this can be solved if the developer simply brings their custom component up to date with the 1.4+ paradigm of using templateString together with dojo.cache, so this bug is likely low in priority; however, out of the box it will cause such customizations to break, which is undesirable - templatePath is currently deprecated but not unsupported.

Attachments (1)

test_TextBoxExtension13.html (583 bytes) - added by Kenneth G. Franqueiro 9 years ago.
test to reproduce issue (run against a source distribution of dojo, revise path to dojo.js as necessary)

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by Kenneth G. Franqueiro

test to reproduce issue (run against a source distribution of dojo, revise path to dojo.js as necessary)

comment:1 Changed 9 years ago by bill

Owner: set to Douglas Hays
Summary: [regression] possibility of "this.templateString is null" on custom dijit.form.TextBox extensions upgrading from 1.3 to 1.4+[regression] TextBox: possibility of "this.templateString is null" on custom dijit.form.TextBox extensions upgrading from 1.3 to 1.4+

comment:2 Changed 9 years ago by Douglas Hays

Milestone: tbd1.5.1
Status: newassigned
Summary: [regression] TextBox: possibility of "this.templateString is null" on custom dijit.form.TextBox extensions upgrading from 1.3 to 1.4+[regression] TextBox: possibility of "this.templateString is null" on custom dijit.form.TextBox extensions upgrading from 1.3 to 1.5

Not a problem in 1.4.

comment:3 Changed 9 years ago by Douglas Hays

(In [22608]) References #11493 (trunk/1.6). Check for non-null templateString before accessing and add simple test for null to test_validate.html

comment:4 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [22609]) Fixes #11493. Backport [22608] to 1.5.1.

comment:5 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.