Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    [bug] __cacheType in DataSourceLoader generated code overrides builtinTypes

    Hi,

    Version v10.0p_2015-04-19/EVAL Deployment (2015-04-19)

    I don't know when this happens, but sometimes the generated code from DataSourceLoader includes validators for joined fields from other datasources that look something like:

    Code:
    {
        __cachedType: isc.SimpleType.create({
          validators: ["isString", {
            max: 10,
            type: "lengthRange"
          }],
          name: "text"
        }),
        hidden: true,
        canEdit: false,
        name: "Name",
        length: 10,
        columnCode: "b35fd19cac14608b161d0c2a1b173f97",
        type: "text"
      },
    When SimpleType.create() is called, the default type isc.builtinTypes.text gets overridden with this new type.

    After the datasources are generated, whenever a DataSource gets used in a Form, SimpleType.addTypeDefaults gets called which assigns the overridden builtinTypes to all the (in this case text-) field. The effect is that all the fields are affected by whichever lengthRange restriction appears last in the generated code from DataSourceLoader.

    Cheers

    #2
    This is something that was corrected in "p" builds about a month ago. It would be great if you could confirm that it goes away after upgrading.

    Comment

    Working...
    X