fix metadata update (empty values)
This commit is contained in:
parent
38b9c433bc
commit
49fa35ae95
1 changed files with 13 additions and 2 deletions
|
@ -4,6 +4,8 @@ oml.ui.identifyDialog = function(data) {
|
|||
|
||||
var ui = oml.user.ui,
|
||||
|
||||
arrayKeys = ['author', 'publisher', 'place', 'language'],
|
||||
|
||||
$form = Ox.Element(),
|
||||
|
||||
$findSelect = Ox.Select({
|
||||
|
@ -161,10 +163,19 @@ oml.ui.identifyDialog = function(data) {
|
|||
oml.api.edit(Ox.extend({
|
||||
id: data.id
|
||||
}, Ox.filter(
|
||||
Ox.map(
|
||||
$list.value($list.options('selected')[0]),
|
||||
function(value, key) {
|
||||
return value || (
|
||||
$updateSelect.value() == 'replace'
|
||||
? (Ox.contains(arrayKeys, key) ? [] : '')
|
||||
: data[key]
|
||||
);
|
||||
}
|
||||
),
|
||||
function(value, key) {
|
||||
return Ox.contains($list.options('keys'), key)
|
||||
&& value != data[key]
|
||||
&& !Ox.isEqual(value, data[key]);
|
||||
}
|
||||
)), function(result) {
|
||||
Ox.Request.clearCache('find');
|
||||
|
|
Loading…
Reference in a new issue