Skip to content

Commit

Permalink
Fixed passing null for trim is deprecated in Mage_Catalog_Model_Attri…
Browse files Browse the repository at this point in the history
…bute_Backend_Customlayoutupdate (OpenMage#3336)
  • Loading branch information
kyrena authored Jun 22, 2023
1 parent c22f7cc commit 0992d8c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Mage_Catalog_Model_Attribute_Backend_Customlayoutupdate extends Mage_Eav_M
public function validate($object)
{
$attributeName = $this->getAttribute()->getName();
$xml = trim($object->getData($attributeName));
$xml = trim((string)$object->getData($attributeName));

if (!$this->getAttribute()->getIsRequired() && empty($xml)) {
return true;
Expand All @@ -42,7 +42,7 @@ public function validate($object)
$validator = Mage::getModel('adminhtml/layoutUpdate_validator');
if (!$validator->isValid($xml)) {
$messages = $validator->getMessages();
//Add first message to exception
// add first message to exception
$massage = array_shift($messages);
$eavExc = new Mage_Eav_Model_Entity_Attribute_Exception($massage);
$eavExc->setAttributeCode($attributeName);
Expand Down

0 comments on commit 0992d8c

Please sign in to comment.