From a2a6b1287b75749096e64b59be0e1493d514c046 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Thu, 18 Oct 2018 17:44:03 +0000 Subject: [PATCH] Make sure that are always included in saved Enketo form output Issue: #4875 --- Gruntfile.js | 3 +++ patches/enketo-inputs-always-relevant.patch | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 patches/enketo-inputs-always-relevant.patch diff --git a/Gruntfile.js b/Gruntfile.js index 19ec2599cd6..ed3fc4fde07 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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(' && '); } diff --git a/patches/enketo-inputs-always-relevant.patch b/patches/enketo-inputs-always-relevant.patch new file mode 100644 index 00000000000..1adba315d09 --- /dev/null +++ b/patches/enketo-inputs-always-relevant.patch @@ -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: + *