Skip to content

Commit 368e2b6

Browse files
committed
Validation change for Text type attributes.
The call on Mage_Eav_Model_Attribute_Data_Text:67 to empty returns true of a value of "0" is entered, as specified in the PHP spec. This prevents the entry of zero on the backend admin for fields. Zero should be a valid value, as it was in our case. No unit tests were created, as no unit tests exist currently for the Eav module.
1 parent af7068a commit 368e2b6

File tree

1 file changed

+1
-1
lines changed
  • app/code/core/Mage/Eav/Model/Attribute/Data

1 file changed

+1
-1
lines changed

app/code/core/Mage/Eav/Model/Attribute/Data/Text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function validateValue($value)
6464
$value = $this->getEntity()->getDataUsingMethod($attribute->getAttributeCode());
6565
}
6666

67-
if ($attribute->getIsRequired() && empty($value)) {
67+
if ($attribute->getIsRequired() && empty($value) && $value !=='0') {
6868
$errors[] = Mage::helper('Mage_Eav_Helper_Data')->__('"%s" is a required value.', $label);
6969
}
7070

0 commit comments

Comments
 (0)