Skip to content

Commit

Permalink
Fix required entry bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kiatng committed Feb 27, 2025
1 parent 0540181 commit 1123693
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/code/core/Mage/Eav/Model/Attribute/Data/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public function validateValue($value)
$attribute = $this->getAttribute();
$label = $attribute->getStoreLabel();

if ($attribute->getIsRequired() && empty($value)) {
$errors[] = Mage::helper('eav')->__('"%s" is a required value.', $label);
}

if ($value === false) {
// try to load original value and validate it
$value = $this->getEntity()->getDataUsingMethod($attribute->getAttributeCode());
}

if ($attribute->getIsRequired() && empty($value)) {
$errors[] = Mage::helper('eav')->__('"%s" is a required value.', $label);
}

if (!$errors && !$attribute->getIsRequired() && empty($value)) {
return true;
}
Expand Down

0 comments on commit 1123693

Please sign in to comment.