From b9608ee8a2cb2ef10dac8cd3d51863fc340ffcbc Mon Sep 17 00:00:00 2001 From: Mark Kaylor Date: Tue, 12 Jul 2022 09:55:40 +0200 Subject: [PATCH] rename namespace to uid --- .../core/strapi/lib/core/registries/custom-fields.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/core/strapi/lib/core/registries/custom-fields.js b/packages/core/strapi/lib/core/registries/custom-fields.js index 2681e84eaa..db850c8773 100644 --- a/packages/core/strapi/lib/core/registries/custom-fields.js +++ b/packages/core/strapi/lib/core/registries/custom-fields.js @@ -29,15 +29,13 @@ const customFieldsRegistry = strapi => { } // When no plugin is specified, or it isn't found in Strapi, default to global - const namespace = strapi.plugin(plugin) - ? `plugin::${plugin}.${name}` - : `global::global.${name}`; + const uid = strapi.plugin(plugin) ? `plugin::${plugin}.${name}` : `global::${name}`; - if (has(namespace, customFields)) { - throw new Error(`Custom field: '${namespace}' has already been registered`); + if (has(uid, customFields)) { + throw new Error(`Custom field: '${uid}' has already been registered`); } - customFields[namespace] = cf; + customFields[uid] = cf; } }, };