From d5f4c99002521da4398a0ca53ab5d10759048a1d Mon Sep 17 00:00:00 2001 From: Steve Lathrop Date: Mon, 26 Nov 2018 20:31:14 -0500 Subject: [PATCH] fix(netlify-cms-core): fix identifier field validation (#1907) --- packages/netlify-cms-core/src/reducers/collections.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/netlify-cms-core/src/reducers/collections.js b/packages/netlify-cms-core/src/reducers/collections.js index e49621de..55e1d29f 100644 --- a/packages/netlify-cms-core/src/reducers/collections.js +++ b/packages/netlify-cms-core/src/reducers/collections.js @@ -114,9 +114,11 @@ export const selectTemplateName = (collection, slug) => selectors[collection.get('type')].templateName(collection, slug); export const selectIdentifier = collection => { const identifier = collection.get('identifier_field'); - const indentifierFields = identifier ? [identifier, ...IDENTIFIER_FIELDS] : IDENTIFIER_FIELDS; + const identifierFields = identifier ? [identifier, ...IDENTIFIER_FIELDS] : IDENTIFIER_FIELDS; const fieldNames = collection.get('fields').map(field => field.get('name')); - return indentifierFields.find(id => fieldNames.find(name => name.toLowerCase().trim() === id)); + return identifierFields.find(id => + fieldNames.find(name => name.toLowerCase().trim() === id.toLowerCase().trim()), + ); }; export const selectInferedField = (collection, fieldName) => { const inferableField = INFERABLE_FIELDS[fieldName];