Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed null parameter warning in DataFlow Profiles #3827

Merged
merged 12 commits into from
Feb 27, 2024
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);
addison74 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Dataflow/Model/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{
parent::_beforeSave();
$actionsXML = $this->getData('actions_xml');
if (strlen($actionsXML) < 0 &&
if ($actionsXML !== null && strlen($actionsXML) < 0 &&

Check failure on line 89 in app/code/core/Mage/Dataflow/Model/Profile.php

View workflow job for this annotation

GitHub Actions / PHPStan / Analyze (ubuntu-latest, 8.3)

Result of && is always false.

Check failure on line 89 in app/code/core/Mage/Dataflow/Model/Profile.php

View workflow job for this annotation

GitHub Actions / PHPStan / Analyze (ubuntu-latest, 8.3)

Result of && is always false.
fballiano marked this conversation as resolved.
Show resolved Hide resolved
@simplexml_load_string('<data>' . $actionsXML . '</data>', null, LIBXML_NOERROR) === false
) {
Mage::throwException(Mage::helper('dataflow')->__("Actions XML is not valid."));
Expand Down
5 changes: 0 additions & 5 deletions phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2945,11 +2945,6 @@ parameters:
count: 1
path: app/code/core/Mage/Dataflow/Model/Profile.php

-
message: "#^Result of && is always false\\.$#"
count: 1
path: app/code/core/Mage/Dataflow/Model/Profile.php

-
message: "#^Right side of && is always true\\.$#"
count: 1
Expand Down
Loading