Skip to content

Commit

Permalink
Make sure that <inputs> are always included in saved Enketo form output
Browse files Browse the repository at this point in the history
Issue: #4875
  • Loading branch information
alxndrsn committed Oct 19, 2018
1 parent 4d98b78 commit a2a6b12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ module.exports = function(grunt) {
// * ignore doc_ids when generating replication id (https://github.com/medic/medic-webapp/issues/2404)
// * improve safari checks (https://github.com/medic/medic-webapp/issues/2797)
'patch node_modules/pouchdb-browser/lib/index.js < patches/pouchdb-browser.patch',

// patch enketo to always mark the /inputs group as relevant
'patch node_modules/enketo-core/src/js/Form.js < patches/enketo-inputs-always-relevant.patch',
];
return patches.join(' && ');
}
Expand Down
14 changes: 14 additions & 0 deletions patches/enketo-inputs-always-relevant.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*** unpatched 2018-10-18 19:54:23.332051962 +0200
--- patched 2018-10-18 19:56:45.975224812 +0200
***************
*** 469,474 ****
--- 469,477 ----
var path = that.input.getName( $node );
var context;

+ // /inputs is ALWAYS relevant #4875
+ if(/\/inputs$/.test(path)) return;
+
/*
* Copied from branch.js:
*

0 comments on commit a2a6b12

Please sign in to comment.