From 0a78a2ab9bd899109a535c7c95e47dadac8e7fbf Mon Sep 17 00:00:00 2001 From: Travis Tidwell Date: Wed, 24 Apr 2024 13:02:49 -0500 Subject: [PATCH 1/3] Fixing the compaison for dates. --- src/Cloner.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Cloner.js b/src/Cloner.js index 0eb80de..5834160 100644 --- a/src/Cloner.js +++ b/src/Cloner.js @@ -234,10 +234,12 @@ class Cloner { if (this.options.submissionsOnly && collection !== 'submissions') { return false; } - if (this.options.createdAfter && srcItem.created < parseInt(this.options.createdAfter, 10)) { + const srcCreated = (srcItem.created instanceof Date) ? srcItem.created.getTime() : parseInt(srcItem.created, 10); + if (this.options.createdAfter && srcCreated < parseInt(this.options.createdAfter, 10)) { return false; } - if (this.options.modifiedAfter && srcItem.modified < parseInt(this.options.modifiedAfter, 10)) { + const srcModified = (srcItem.created instanceof Date) ? srcItem.modified.getTime() : parseInt(srcItem.modified, 10); + if (this.options.modifiedAfter && srcModified < parseInt(this.options.modifiedAfter, 10)) { return false; } return true; From 2fd7b6e55e97c5c65922f70f9c9524a4edab1f3c Mon Sep 17 00:00:00 2001 From: Travis Tidwell Date: Wed, 24 Apr 2024 13:03:54 -0500 Subject: [PATCH 2/3] Fixed name of variable. --- src/Cloner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Cloner.js b/src/Cloner.js index 5834160..ee37ec9 100644 --- a/src/Cloner.js +++ b/src/Cloner.js @@ -238,7 +238,8 @@ class Cloner { if (this.options.createdAfter && srcCreated < parseInt(this.options.createdAfter, 10)) { return false; } - const srcModified = (srcItem.created instanceof Date) ? srcItem.modified.getTime() : parseInt(srcItem.modified, 10); + // eslint-disable-next-line max-len + const srcModified = (srcItem.modified instanceof Date) ? srcItem.modified.getTime() : parseInt(srcItem.modified, 10); if (this.options.modifiedAfter && srcModified < parseInt(this.options.modifiedAfter, 10)) { return false; } From 2946cfce68fde4bab2a02c1f9de614e15203e855 Mon Sep 17 00:00:00 2001 From: Travis Tidwell Date: Mon, 25 Nov 2024 19:24:15 -0600 Subject: [PATCH 3/3] Upgrade package version. --- package.json | 2 +- src/Cloner.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5d6ebcf..88f68af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formio/cli", - "version": "2.3.0", + "version": "2.3.1-rc.1", "description": "The Form.io Command Line Interface application.", "main": "index.js", "scripts": { diff --git a/src/Cloner.js b/src/Cloner.js index ee37ec9..3e21ee1 100644 --- a/src/Cloner.js +++ b/src/Cloner.js @@ -1033,6 +1033,9 @@ class Cloner { return; } const decryptedDstSettings = dest ? this.decrypt(this.options.dstDbSecret, dest['settings_encrypted'], true) : {}; + if (!decryptedDstSettings) { + return; + } if (decryptedDstSettings.secret) { this.dstSecret = decryptedDstSettings.secret; }