FLUID-5184: Cannot override a this-ist invoker with a that-ist one

Metadata

Source
FLUID-5184
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Justin Obara
Created
2013-10-18T12:48:55.653-0400
Updated
2019-07-12T09:13:40.916-0400
Versions
N/A
Fixed Versions
  1. 2.0
Component
  1. Framework
  2. IoC System

Description

If the default configuration of an invoker uses the "this-ist" notation, it cannot be overridden
with a that-ist implementation.

For example:

fluid.defaults("fluid.logger", {
    ...
    invokers: {
        log: {
            "this": "thisistThing",
            "method": "log"
        }
    }
    ...
})

var logger = fluid.logger({
    invokers: {
        log: {
            funcName: "console.log"
        }
    }
})

A call to logger.log would call the original this-ist function instead of the overriding function provided.

Comments

  • Justin Obara commented 2013-10-18T12:52:54.664-0400

    Submitted a pull request with a unit test demonstrating the issue.
    https://github.com/fluid-project/infusion/pull/418

  • Antranig Basman commented 2013-10-18T13:06:26.138-0400

    It's necessary to the way invokers are used that their configuration is merged together, rather than them replacing each other wholesale. For example, it is necessary to the use case where the user wants to override either the argument list or the function name without changing the other. In this case you need to ensure that the original invoker fields are eliminated, for example by overriding them with "null", so that the record can be interpreted as a different invoker record type - for example

    invokers: {
        log: {
            method: null,
            "this": null,
            funcName: "console.log"
            }
        }
    
  • Antranig Basman commented 2015-08-06T13:33:10.002-0400

    I think that is is really a usability bug after all. We should resolve it together with FLUID-5714

  • Antranig Basman commented 2015-08-20T15:50:15.109-0400

    Merged into trunk at revision 282f1a318718eed0b0ec060fb8b4ad254417fd7e