Skip to content

EspoCRM – Open Source CRM Application

Enum 0 value fix

Yurii9d8d28c8b058
diff --git a/client/src/views/fields/enum.ts b/client/src/views/fields/enum.ts
index a4dfb9bdce..39111c4c35 100644
--- a/client/src/views/fields/enum.ts
+++ b/client/src/views/fields/enum.ts
@@ -176,7 +176,7 @@ class EnumFieldView<
}
}
- const translationKey = value || '';
+ const translationKey = value ?? '';
if (
typeof value !== 'undefined' && value !== null && value !== ''
@@ -196,7 +196,6 @@ class EnumFieldView<
this.translatedOptions ?
(this.translatedOptions[translationKey] || value) :
this.getLanguage().translateOption(translationKey, this.name, this.entityType);
-
}
if (this.isEditMode()) {
@@ -261,7 +260,7 @@ class EnumFieldView<
this.setupTranslation();
if (this.translatedOptions === null) {
- const translations = (this.getLanguage().translate(this.name, 'options', this.model.name) ?? {}) as any;
+ const translations = (this.getLanguage().translate(this.name, 'options', this.model.entityType) ?? {}) as any;
if (translations === this.name) {
this.translatedOptions = null;