Hotfixes

Unifi can be patched between releases by using a special Script Include called hotfix. This page contains any hotfixes that have been made for this version. Follow the instructions to apply them.

If you find a bug in Unifi we may issue a hotfix so you can get the features you need without having to upgrade.

Unifi has a Script Include called hotfix. Simply replace the script in the hotfix Script Include with the one shown below and you will instantly have access to the fixes.

These hotfixes will be shipped as real fixes with the next version of Unifi, so make sure you have the correct hotfix for your version.

/**
 * Executes a child function corresponding to the object's type property.
 * The object is passed to the child function so methods and properties can be overridden.
 *
 * @param  {Object} obj The full class object to be patched.
 */
function hotfix(obj) {
  var type = typeof obj === 'function' ? obj.prototype.type : obj.type;
  if (type && typeof hotfix[type] === 'function') {
    hotfix[type](obj);
  }
}

hotfix.version = '3.0.3.2';

hotfix.Message = function (Message) {
  Message.prototype.evaluateScript = function evaluateScript(record, element, vars) {
    var source = vars.source;
    var result;
    vars.message = this.getRecord();
    vars.variables = this.getIntegration().getActiveConnection().getVariables();
    if (vars.stage) {
      vars.$stage = vars.stage.$stage;
    }
    result = utils.evaluateScript(record, element, vars);

    // UN-1003: reset source - GlideScopedEvaluator changes the GlideRecord object
    // to ScopedGlideRecord which breaks object equality.
    if (source && source.$model) {
        source.$model.setRecord(source);
    }

    return result;
  };
}

Last updated