Ticket #5226 (assigned defect)

Opened 7 months ago

Last modified 8 weeks ago

dijit._Templated does not replace booleans correctly

Reported by: guest Owned by: alex
Priority: normal Milestone: 1.2
Component: Dijit Version: 1.0
Severity: critical Keywords:
Cc: ptwobrussell@…

Description (last modified by ptwobrussell) (diff)

If a widget contains e.g:

myBool: false

and your template contains:

<div dojoType="myWidget" value="${myBool}"></div>

value is evaluated to true.

This happened after changeset r10979 when the following was added on line 64 in the buildRendering function:

if(!value){ return ""; }  

The buildRendering function now replaces ${myBool} with "" instead of "false".

After this the str2obj function is called in the dojo parser. In the boolean case the following code is run:

return typeof value == "boolean" ? value : !(value.toLowerCase()=="false"); 

Since value is "" it returns true.

Regards, Thomas

Attachments

foo.html (1.2 kB) - added by ptwobrussell 8 weeks ago.
A test case illustrating the behavior - useful to illustrate the bug.

Change History

Changed 7 months ago by peller

  • owner set to alex

Changed 7 months ago by bill

Is this problem specific to the parameter named "value" (which is special, btw), or does it happen with any parameter name?

Changed 7 months ago by guest

It happens with any parameter name.

Changed 7 months ago by peller

  • milestone changed from 1.0.2 to 1.0.3

Changed 7 months ago by alex

  • status changed from new to assigned

Changed 4 months ago by dylan

  • milestone changed from 1.0.3 to 1.1

Changed 4 months ago by bill

  • priority changed from highest to normal

Changed 3 months ago by bill

  • milestone changed from 1.1 to 1.2

Move all milestone 1.1 tickets to 1.2, except for reopened tickets and tickets opened after 1.1RC1 was released.

Changed 8 weeks ago by ptwobrussell

A test case illustrating the behavior - useful to illustrate the bug.

Changed 8 weeks ago by ptwobrussell

  • cc ptwobrussell@… added
  • description modified (diff)
Note: See TracTickets for help on using tickets.