Announcement

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

    Patch needed to prevent overwriting of sortNormalizer on formulas

    Hello,

    We have logic of our own to set sortNormalizers on our user-defined formulas. With 9.1, we noticed our sortNormalizers were no longer being applied. So, I inspected the code and found the problem and created a patch. You'll see the method below will check to see if a sortNormalizer already exists. If it doesn't, then it creates one. But, if it does, it does nothing.

    Would you be willing to apply this patch to your codebase? Alternatively, the reason we defined our own patch was to treat both infinity and NaN values as null for accurate sorting.

    Code:
    if (window.isc && (isc.version.indexOf("v9.1")>-1)) {
    	
    	isc.Canvas.getPrototype().addProperties({
    
    		getFormulaFunction:
    			function (_1){
    				if(!_1||!_1.userFormula)return null;
    				
    				var _2=_1.$65w;
    				if(_2!=null&&_2.$111j==_1.userFormula)return _2;
    			
    				_2=_1.$65w=isc.FormulaBuilder.generateFunction(_1.userFormula,this.getAllFields(),this);
    				_2.$111j=_1.userFormula;
    				
    				//4/26/13..check to ensure sortNormalizer isn't already defined
    				if(_1.sortNormalizer==null){
    					var _3=function(_4,_1,_5){return _2(_4,_5)}
    					_1.sortNormalizer=_3;					
    				}
    				
    				return _2
    			}
    	})
    			
    }

    #2
    Thanks. We'll add the logic you suggest to SC 9.1p/10.d, and it will be in the next nightly builds.

    (We're not sure what version of SC you were using previously that didn't require this patch - it appears it would be needed for the current builds of SC 8.3p and 9.0p as well.)

    Comment


      #3
      Thank you. We were using 9.0. My guess is that the formula enhancements you built into 9.1 involved calling getFormulaFunction in some different sequence than before which caused this overwriting behavior to start with 9.1. Previously my definition was probably overwriting yours.

      Comment

      Working...
      X