Commit 17013c28 authored by Kristoffer Moe's avatar Kristoffer Moe
Browse files

Merge branch 'hotfix/DEICH-469_mangler_oppdatering_ved_sletting_av_opplysninger'

parents f7f4fbd3 ba317959
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
if (_.isArray(oldValue) && !_.isArray(currentValue)) { if (_.isArray(oldValue) && !_.isArray(currentValue)) {
currentValue = [ currentValue ]; currentValue = [ currentValue ];
} }
if (([ 'string', 'number', 'boolean' ].indexOf(typeof currentValue) > -1) && currentValue != oldValue) { if (([ 'string', 'number', 'boolean' ].indexOf(typeof currentValue) > -1) && currentValue !== oldValue) {
if (currentValue !== "" && (typeof currentValue !== 'boolean' || currentValue !== false)) { if (currentValue !== "" && (typeof currentValue !== 'boolean' || currentValue !== false)) {
var addPatch = { op: "add", s: subject, p: predicate, o: { value: currentValue, type: datatype } }; var addPatch = { op: "add", s: subject, p: predicate, o: { value: currentValue, type: datatype } };
if (oldAndCurrentValue.current.lang !== "") { if (oldAndCurrentValue.current.lang !== "") {
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
addPatches.push(addPatch); addPatches.push(addPatch);
} }
if (oldValue !== "" && oldValue !== null && currentValue !== '') { if (oldValue !== "" && oldValue !== null) {
var delPatch = { op: "del", s: subject, p: predicate, o: { value: oldValue } }; var delPatch = { op: "del", s: subject, p: predicate, o: { value: oldValue } };
if (oldAndCurrentValue.old.lang !== "") { if (oldAndCurrentValue.old.lang !== "") {
delPatch.o.lang = oldAndCurrentValue.old.lang; delPatch.o.lang = oldAndCurrentValue.old.lang;
......
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