FLUID-6137: Cannot use distributeOptions to distribute an option when the source points at a value of 0

Metadata

Source
FLUID-6137
Type
Bug
Priority
Blocker
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Justin Obara
Created
2017-02-28T09:44:37.615-0500
Updated
2017-03-01T11:05:43.789-0500
Versions
  1. 2.0
Fixed Versions
  1. 3.0
Component
  1. Framework
  2. IoC System

Description

When trying to use distribute options to pass along an option to another component, if using the source property to point at a value of 0, it is not passed along.

Example:

fluid.defaults("fluid.tests.distributeOptionsZero", {
        gradeNames: ["fluid.component"],
        components: {
            child: {
                type: "fluid.component"
            }
        },
        toDistribute: 0,
        distributeOptions: [{
            source: "{that}.options.toDistribute",
            target: "{that child}.options.fromSource"
        }]
    });

However, if the "record" property is used instead, it will be passed along.

Example:

fluid.defaults("fluid.tests.distributeOptionsZero", {
        gradeNames: ["fluid.component"],
        components: {
            child: {
                type: "fluid.component"
            }
        },
        distributeOptions: [{
            record: 0,
            target: "{that child}.options.fromRecord"
        }]
    });

Comments