From f91aeec3c87f5de523517f7a46b6410a1ea08a3d Mon Sep 17 00:00:00 2001 From: Rish Date: Thu, 1 Oct 2020 22:46:45 +0530 Subject: [PATCH] Fixed members form missing data-members-name refs #12249 refs https://github.com/TryGhost/Ghost/commit/ce14d8113aa91e4b0d7d5c7340404f389806b1d1 This was incorrectly assuming the presence of the data-members-name element in the document. By guarding against it and defaulting to undefined, we fallback to the existing behaviour when the element is not present. --- ghost/portal/src/data-attributes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/portal/src/data-attributes.js b/ghost/portal/src/data-attributes.js index 38e1b7721a..ec9cad9c23 100644 --- a/ghost/portal/src/data-attributes.js +++ b/ghost/portal/src/data-attributes.js @@ -14,7 +14,7 @@ function handleDataAttributes({siteUrl}) { let emailInput = event.target.querySelector('input[data-members-email]'); let nameInput = event.target.querySelector('input[data-members-name]'); let email = emailInput.value; - let name = nameInput.value; + let name = (nameInput && nameInput.value) || undefined; let emailType = undefined; let labels = [];