Skip to content

Commit

Permalink
Merge pull request #3654 from huridocs/migration38_hotfix
Browse files Browse the repository at this point in the history
migration 38 hotfix
  • Loading branch information
konzz authored May 10, 2021
2 parents 92c6e51 + 75b726c commit 16f4cdf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
p => p._id && p._id.toString() === prop.inheritProperty.toString()
);

elem.inheritedValue = partner.metadata[inheritedProperty.name] || [];
elem.inheritedValue = (partner.metadata || {})[inheritedProperty.name] || [];
elem.inheritedType = inheritedProperty.type;
}
return elem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ describe('migration denormalize-inherited', () => {
label: 'test_doc 5',
value: '789ABC',
},
{
inheritedType: 'text',
inheritedValue: [],
label: 'There is only zull',
value: 'zull',
},
]);
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import db from 'api/utils/testing_db';
const templateId = db.id();
const templateId2 = db.id();
const zull = db.id();
const inheritPropertyId = db.id();
export default {
entities: [
Expand Down Expand Up @@ -36,7 +37,10 @@ export default {
title: 'test_doc 4',
sharedId: '498ABC',
metadata: {
friend: [{ value: '789ABC', label: 'test_doc 5' }],
friend: [
{ value: '789ABC', label: 'test_doc 5' },
{ value: 'zull', label: 'There is only zull' },
],
},
language: 'en',
},
Expand All @@ -55,8 +59,11 @@ export default {
template: 'whats a template?',
},
{
_id: zull,
sharedId: 'zull',
title: 'There is only zull',
template: templateId,
language: 'en',
template: templateId2,
},
],
templates: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uwazi",
"version": "1.29.0",
"version": "1.29.1",
"description": "Uwazi is a free, open-source solution for organising, analysing and publishing your documents.",
"keywords": [
"react"
Expand Down

0 comments on commit 16f4cdf

Please sign in to comment.