Commit 9006d668 authored by Boris Kocherov's avatar Boris Kocherov Committed by Romain Courteaud

[erp5_only_office] disable using cache for discoverMDMembers

parent 7c46f41d
...@@ -430,38 +430,37 @@ function (window, RSVP, Xmla, console) { ...@@ -430,38 +430,37 @@ function (window, RSVP, Xmla, console) {
} }
if (opt.member_uname) { if (opt.member_uname) {
prop.restrictions["MEMBER_UNIQUE_NAME"] = opt.member_uname; prop.restrictions["MEMBER_UNIQUE_NAME"] = opt.member_uname;
cached_member = scheme.members[opt.member_uname];
} }
if (opt.level_uname) { if (opt.level_uname) {
prop.restrictions["LEVEL_UNIQUE_NAME"] = opt.level_uname; prop.restrictions["LEVEL_UNIQUE_NAME"] = opt.level_uname;
} }
if (cached_member) { if (opt.tree_op) {
return [cached_member]; prop.restrictions["TREE_OP"] = opt.tree_op;
} else { }
return xmla_request_retry("discoverMDMembers", settings) return xmla_request_retry("discoverMDMembers", settings)
.push(function (r) { .push(function (r) {
var ret = [], var ret = [],
uname, uname,
level, level,
cached_member1; cached_member;
while (r.hasMoreRows()) { while (r.hasMoreRows()) {
uname = r["getMemberUniqueName"](); uname = r["getMemberUniqueName"]();
level = r["getLevelUniqueName"](); level = r["getLevelUniqueName"]();
// we can check cache twice because fist check // we can check cache twice because fist check
// only if discover by member_uname // only if discover by member_uname
if (!scheme.members.hasOwnProperty(uname)) { if (!scheme.members.hasOwnProperty(uname)) {
cached_member1 = { cached_member = {
uname: uname, uname: uname,
h: r["getHierarchyUniqueName"](), h: r["getHierarchyUniqueName"](),
level: r["getLevelUniqueName"](), level: r["getLevelUniqueName"](),
caption: r["getMemberCaption"](), caption: r["getMemberCaption"](),
type: r["getMemberType"]() type: r["getMemberType"]()
}; };
scheme.members[uname] = cached_member1; scheme.members[uname] = cached_member;
} else { } else {
cached_member1 = scheme.members[uname]; cached_member = scheme.members[uname];
} }
ret.push(cached_member1); ret.push(cached_member);
r.nextRow(); r.nextRow();
if (!scheme.levels.hasOwnProperty(level)) { if (!scheme.levels.hasOwnProperty(level)) {
scheme.levels[level] = discover_level(connection, scheme, level); scheme.levels[level] = discover_level(connection, scheme, level);
...@@ -469,7 +468,6 @@ function (window, RSVP, Xmla, console) { ...@@ -469,7 +468,6 @@ function (window, RSVP, Xmla, console) {
} }
return ret; return ret;
}); });
}
}); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment