Skip to content

Commit 4297fb6

Browse files
authored
Merge pull request #2315 from laws-africa/fix-eid
include parent prefix when rewriting all eids
2 parents 2a21220 + abca0da commit 4297fb6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

indigo_app/static/javascript/indigo/models.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@
6262
if (options && options.fromContent) return;
6363

6464
// rewrite all eIds before setting the content
65-
new indigoAkn.EidRewriter().rewriteAllEids(this.xmlDocument.documentElement);
65+
// in provision mode, retain the eId of the parent element as the prefix
66+
let eidPrefix;
67+
if (Indigo.Preloads.provisionEid && Indigo.Preloads.provisionEid.lastIndexOf('__') > -1) {
68+
eidPrefix = Indigo.Preloads.provisionEid.substring(0, Indigo.Preloads.provisionEid.lastIndexOf('__'));
69+
}
70+
new indigoAkn.EidRewriter().rewriteAllEids(this.xmlDocument.documentElement, eidPrefix);
6671
// rewrite all attachment FRBR URI work components too
6772
new indigoAkn.WorkComponentRewriter().rewriteAllAttachmentWorkComponents(this.xmlDocument.documentElement);
6873
this.set('content', this.toXml(), {fromXmlDocument: true});

0 commit comments

Comments
 (0)