FLUID-6437: "{that}" distributed using "record" points to the source component

Metadata

Source
FLUID-6437
Type
Bug
Priority
Major
Status
Open
Resolution
N/A
Assignee
Antranig Basman
Reporter
Cindy Li
Created
2019-11-28T15:36:54.773-0500
Updated
2019-11-28T16:00:56.666-0500
Versions
N/A
Fixed Versions
N/A
Component
  1. Framework

Description

When using "record" to distribute an option value with a reference to "{that}", "{that}" will be resolved to the source component rather than the target component. In this example:

distributeOptions: [{
    record: "{that}.options.toDistribute",
    target: "{that child}.options.toDistributeTarget"
}]

"that.options.toDistribute" will be resolve to the value of "options.toDistribute" of the source component.

The branch with the test case to demonstrate this problem is https://github.com/cindyli/infusion/tree/FLUID-6437

Comments

  • Antranig Basman commented 2019-11-28T16:00:22.974-0500

    Note that this is not necessarily a problem, since as it has turned out in the context of use, this was the desirable behaviour on most occasions. In practice it seems that we "forgot" in between the filing of FLUID-5258 and FLUID-6214 that the behaviour to resolve at the source was explicitly implemented, as seen in this implementation of fluid.generateExpandBlock:

    fluid.generateExpandBlock = function (record, that, mergePolicy, localRecord) {
            var expanded = fluid.expandOptions(record.options, record.contextThat || that, mergePolicy, localRecord, {defer: true});
    

    Note that the inconsistency noted in FLUID-5258 remains, in that material distributed into listener and invoker arguments will resolve at the target rather than the source.