Skip to content

Commit 00de7b5

Browse files
kiatngsreichel
andauthored
Fixed null deprecation in Mage_Eav_Model_Attribute_Data_Text (#4500)
* Fixed null deprecation in Mage_Eav_Model_Attribute_Data_Text * Update app/code/core/Mage/Eav/Model/Attribute/Data/Text.php --------- Co-authored-by: Sven Reichel <[email protected]>
1 parent 031de28 commit 00de7b5

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function extractValue(Zend_Controller_Request_Http $request)
3737
* Validate data
3838
* Return true or array of errors
3939
*
40-
* @param array|string $value
40+
* @param string|bool|null $value
4141
* @return bool|array
4242
*/
4343
public function validateValue($value)
@@ -51,7 +51,7 @@ public function validateValue($value)
5151
$value = $this->getEntity()->getDataUsingMethod($attribute->getAttributeCode());
5252
}
5353

54-
if ($attribute->getIsRequired() && strlen($value) == 0) {
54+
if ($attribute->getIsRequired() && (string) $value === '') {
5555
$errors[] = Mage::helper('eav')->__('"%s" is a required value.', $label);
5656
}
5757

@@ -60,7 +60,7 @@ public function validateValue($value)
6060
}
6161

6262
// validate length
63-
$length = Mage::helper('core/string')->strlen(trim($value));
63+
$length = Mage::helper('core/string')->strlen(trim((string) $value));
6464

6565
$validateRules = $attribute->getValidateRules();
6666
if (!empty($validateRules['min_text_length']) && $length < $validateRules['min_text_length']) {

0 commit comments

Comments
 (0)