Skip to content

Commit

Permalink
PHP8: fixes passing null in `Mage_Adminhtml_Block_System_Convert_Gui_…
Browse files Browse the repository at this point in the history
…Edit_Tab_Wizard::getValue()` (#6)

* PHP8: fixes passing null in Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard::getValue()

* Added docblock to template
  • Loading branch information
sreichel authored Feb 13, 2024
1 parent d59529b commit c562b79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getValue($key, $default = '', $defaultNew = null)
}

$value = $this->getData($key);
return $this->escapeHtml(strlen($value) > 0 ? $value : $default);
return $this->escapeHtml(is_string($value) && strlen($value) > 0 ? $value : $default);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Dataflow/Model/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
* @method $this setUpdatedAt(string $value)
* @method string getActionsXml()
* @method $this setActionsXml(string $value)
* @method string getGuiData()
* @method $this setGuiData(string $value)
* @method mixed getGuiData()
* @method $this setGuiData(mixed $value)
* @method string getDirection()
* @method $this setDirection(string $value)
* @method string getEntityType()
Expand Down Expand Up @@ -85,7 +85,7 @@ protected function _afterLoad()
protected function _beforeSave()
{
parent::_beforeSave();
$actionsXML = $this->getData('actions_xml');
$actionsXML = $this->getData('actions_xml') ?? '';
if (strlen($actionsXML) < 0 &&
@simplexml_load_string('<data>' . $actionsXML . '</data>', null, LIBXML_NOERROR) === false
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
?>
<?php
/**
* @var Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard $this
*
* @methods
* - getValue($key, $default)
* - getSelected($key, $value)
Expand Down

0 comments on commit c562b79

Please sign in to comment.