Search…
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.
1
/**
2
* Executes a child function corresponding to the object's type property.
3
* The object is passed to the child function so methods and properties can be overridden.
4
*
5
* @param {Object} obj The full class object to be patched.
6
*/
7
function hotfix(obj) {
8
var type = typeof obj === 'function' ? obj.prototype.type : obj.type;
9
if (type && typeof hotfix[type] === 'function') {
10
hotfix[type](obj);
11
}
12
}
13
14
hotfix.version = '3.1.1.1';
15
16
hotfix.WsupInclForm = function (WsupInclForm) {
17
WsupInclForm.prototype.getRecordElements = function getRecordElements(gr) {
18
var fields = portal_utils.getRecordElements(gr, portal_utils.getFieldNames(gr, true));
19
for (var name in fields) {
20
fields[name].displayValue = fields[name].display_value;
21
delete fields[name].display_value;
22
}
23
return fields;
24
};
25
};
26
27
hotfix.portal_utils = function (portal_utils) {
28
portal_utils.getRecordElements = function getRecordElements(table, sys_id, field_names) {
29
var tmp = {}, gr;
30
31
if (table.toString().indexOf('GlideRecord') >= 0) {
32
gr = table;
33
field_names = sys_id;
34
} else {
35
gr = new GlideRecordSecure(table);
36
if (!gr.isValid()) {
37
gs.addErrorMessage('Invalid table: ' + table);
38
return;
39
}
40
if (sys_id == '-1') {
41
gr.initialize();
42
} else if (!gr.get(sys_id)) {
43
gs.addErrorMessage('Invalid sys_id for table ' + table + ':' + sys_id);
44
return;
45
}
46
}
47
48
$sp.getRecordElements(tmp, gr, field_names || portal_utils.getFieldNames(gr));
49
50
for (var name in tmp) {
51
delete tmp[name].type; // this is not the value required by spForm field renderer
52
tmp[name].readonly = gr.isValidField(name) ? !gr.getElement(name).canWrite() : false;
53
tmp[name].sys_readonly = tmp[name].readonly;
54
}
55
56
return tmp;
57
};
58
};
Copied!
Last modified 24d ago
Export as PDF
Copy link