Announcement

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

    Error upgrading from 2015-10-05_LGPL to 2016-01-12_LGPL

    There is a new implementation of _saveDataReply in ValuesManager. This has a bug.

    Problem
    The browser fails with error getItems is not a function.
    ISC_Forms.js@63182:
    Code:
            if (!this.suppressServerDataSync && response && response.status >= 0 && data != null) {
                if (isc.isAn.Array(data)) data = data[0];
                if (request.data) request.data = isc.shallowClone(request.data);
    
                var nestedDataStructure = false,
                    members = this.getMembers();
                for (var i = 0; i < members.length; i++) {
                    if (members[i].dataPath != null) {
                        nestedDataStructure = true;
                    } else if (!isc.isA.DynamicForm(members[i])) {
                        var items = members[i].getItems();   // THIS IS UNSAFE. It is not guaranteed getItems() is a function.
                        if (items[i].dataPath != null) {
                            nestedDataStructure = true;
                        }
                    }
                    if (nestedDataStructure) break;
                }

    Possible solution:
    Check if getItems is a function.
    Code:
            if (!this.suppressServerDataSync && response && response.status >= 0 && data != null) {
                if (isc.isAn.Array(data)) data = data[0];
                if (request.data) request.data = isc.shallowClone(request.data);
    
                var nestedDataStructure = false,
                    members = this.getMembers();
                for (var i = 0; i < members.length; i++) {
                    if (members[i].dataPath != null) {
                        nestedDataStructure = true;
                    } else if (!isc.isA.DynamicForm(members[i]) && isA.Function(members[i].getItems)) {
                        var items = members[i].getItems();  
                        if (items[i].dataPath != null) {
                            nestedDataStructure = true;
                        }
                    }
                    if (nestedDataStructure) break;
                }

    #2
    And another problem.. (don't know if this is by design)

    DataSource.combineFieldData introduces a new dontDuplicateEditorProperties property. But the implementation does not make sense to me.
    If you want to override editorProperties of a field in a ListGrid, it will get initialized with the editorProperties from the datasource!

    ISC_DataBinding.js@28741
    Code:
                if (!this.dontDuplicateEditorProperties) {
                    if (propertyName == "editorProperties") {
                        localField.editorProperties = isc.addProperties({}, dsField.editorProperties);
                        continue;
                    }
                }
    I think it would make more sense to:
    Code:
                if (!this.dontDuplicateEditorProperties) {
                    if (propertyName == "editorProperties") {
                        localField.editorProperties = isc.addProperties(localField.editorProperties||{}, dsField.editorProperties);
                        continue;
                    }
                }
    So add the dsField editorProperties to the localField editorProperties.

    OR
    change the default:
    isc.DataSource.addClassProperties({
    dontDuplicateEditorProperties:true
    });

    So it is consistent with previous behaviour
    Last edited by dencel; 15 Jan 2016, 12:27.

    Comment


      #3
      Just a note to let you know both these issues are queued up for investigation. We'll follow up when we have more information for you.

      Regards
      Isomorphic Software

      Comment


        #4
        The issue in post #1 is now resolved. Please try the next nightly build dated Jan 21 or above to pick that up.

        We'll follow up about #2 separately

        Regards
        Isomorphic Software

        Comment


          #5
          Issue #2 was indeed an implementation bug - the intended behavior was for the local field editorProperties to be combined with any dataSource-level settings -- with the local settings taking precedence in the case of any collisions.
          This is now resolved - also in the Jan 21 build.

          Regards
          Isomorphic Software

          Comment

          Working...
          X