From 0992d8ce74bba64bcee52bc9185b47ff6f6268a9 Mon Sep 17 00:00:00 2001 From: kyrena <78410399+kyrena@users.noreply.github.com> Date: Thu, 22 Jun 2023 07:21:00 +0200 Subject: [PATCH] Fixed passing null for trim is deprecated in Mage_Catalog_Model_Attribute_Backend_Customlayoutupdate (#3336) --- .../Catalog/Model/Attribute/Backend/Customlayoutupdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php b/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php index cfc84f778b4..236853fdb8b 100644 --- a/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php +++ b/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php @@ -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; @@ -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);