Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #900 from jkuester/fix/890-warn-multiple-meta
Browse files Browse the repository at this point in the history
Update meta selector used when setting deprecatedID
  • Loading branch information
eyelidlessness authored Jun 2, 2022
2 parents e66fb8a + cf51839 commit 484eb18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/form-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ FormModel.prototype.setInstanceIdAndDeprecatedId = function () {
'text/xml'
).documentElement;
this.xml.adoptNode(deprecatedIdEl);
metaEl = this.xml.querySelector('* > meta');
metaEl = this.xml.querySelector('instance > * > meta');
metaEl.appendChild(deprecatedIdEl);
}
}
Expand Down
5 changes: 3 additions & 2 deletions test/spec/formmodel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1721,10 +1721,11 @@ describe('merging an instance into the model', () => {
describe('when a deprecatedID node is not present in the form format', () => {
[
{
// #890 Including second nested `meta` to validate selection logic when setting deprecatedID
modelStr:
'<model><instance><thedata id="thedata"><nodeA/><meta><instanceID/></meta></thedata></instance></model>',
'<model><instance><thedata id="thedata"><nodeA/><mygroup><meta/></mygroup><meta><instanceID/></meta></thedata></instance></model>',
instanceStr:
'<thedata id="thedata"><meta><instanceID>7c990ed9-8aab-42ba-84f5-bf23277154ad</instanceID></meta><nodeA>2012</nodeA></thedata>',
'<thedata id="thedata"><mygroup><meta/></mygroup><meta><instanceID>7c990ed9-8aab-42ba-84f5-bf23277154ad</instanceID></meta><nodeA>2012</nodeA></thedata>',
text: 'with meta block in default namespace, ',
},
// same as previous except for the namespace of the meta block and its childnodes
Expand Down

0 comments on commit 484eb18

Please sign in to comment.