Skip to content

Commit 3fab44d

Browse files
authored
Bugfix: allow defaultvalue 0 for numeric fields (#946)
1 parent 7b7c5e2 commit 3fab44d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public/js/pimcore/object/tags/numeric.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ pimcore.object.tags.numeric = Class.create(pimcore.object.tags.abstract, {
2626

2727
applyDefaultValue: function() {
2828
this.defaultValue = null;
29-
if ((typeof this.data === "undefined" || this.data === null) && this.fieldConfig.defaultValue) {
29+
if ((typeof this.data === "undefined" || this.data === null) &&
30+
(this.fieldConfig.defaultValue || this.fieldConfig.defaultValue === 0)
31+
) {
3032
this.data = this.fieldConfig.defaultValue;
3133
this.defaultValue = this.fieldConfig.defaultValue;
3234
}

0 commit comments

Comments
 (0)