Skip to content
Snippets Groups Projects
Commit ff687263 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

GDPR: Workaround for loading by idvalues (e.g. on "Save and Open")

parent 303e82a3
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,20 @@ var filterCond;
if (vars.exists("$local.idvalues") && vars.get("$local.idvalues") && vars.get("$local.idvalues").length > 0)
{
filterCond = newWhere("DSGVO.DSGVOID", vars.get("$local.idvalues"), SqlBuilder.IN());
//this is a workaround: when using $local.idvalues the contactId-param may not be set.
//But the DataPrivacyUtils.collectAll function needs a contactId to work properly, and there exists no other function to load the data by uids
//when the upper TODO is done, this workaround can be removed
if (contactId == null)
{
var contactIds = (new SqlBuilder()).selectDistinct("DSGVO.CONTACT_ID")
.from("DSGVO")
.where(filterCond)
.arrayColumn();
if (contactIds.length > 1)
throw new Error("DSGVO_entity.jdito.contentProcess: tried to load data for more than one contact; this is not implemented");
contactId = contactIds[0];
}
}
var data = DataPrivacyUtils.collectAll(contactId, filterCond)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment