diff --git a/lib/formats/openrosa.js b/lib/formats/openrosa.js index 836de88d2..0bac8f0af 100644 --- a/lib/formats/openrosa.js +++ b/lib/formats/openrosa.js @@ -62,7 +62,7 @@ const formManifestTemplate = template(200, ` {{#attachments}} {{#hasSource}} - + {{name}} md5:{{openRosaHash}} {{{domain}}}{{{basePath}}}/attachments/{{urlName}} @@ -76,7 +76,8 @@ const formManifest = (data) => formManifestTemplate(mergeRight(data, { attachments: data.attachments.map((attachment) => attachment.with({ hasSource: attachment.blobId || attachment.datasetId, - urlName: encodeURIComponent(attachment.name) + urlName: encodeURIComponent(attachment.name), + isDataset: attachment.datasetId != null })) })); diff --git a/test/integration/api/datasets.js b/test/integration/api/datasets.js index f336a509a..a5abd3fc2 100644 --- a/test/integration/api/datasets.js +++ b/test/integration/api/datasets.js @@ -1884,7 +1884,7 @@ describe('datasets and entities', () => { const domain = config.get('default.env.domain'); manifest.should.equal(` - + goodone.csv md5:${etag.replace(/"/g, '')} ${domain}/v1/projects/1/forms/withAttachments/attachments/goodone.csv @@ -1968,7 +1968,7 @@ describe('datasets and entities', () => { const domain = config.get('default.env.domain'); manifest.should.equal(` - + goodone.csv md5:${etag.replace(/"/g, '')} ${domain}/v1/projects/1/forms/withAttachments/attachments/goodone.csv @@ -2843,7 +2843,7 @@ describe('datasets and entities', () => { const domain = config.get('default.env.domain'); text.should.be.eql(` - + people.csv md5:${etag.replace(/"/g, '')} ${domain}/v1/projects/1/forms/withAttachments/attachments/people.csv