Created
July 21, 2022 11:18
-
-
Save jbrada/de20589e06ebca9f7591b89eca2ad200 to your computer and use it in GitHub Desktop.
Issue in the Bss_ProductLabel module on Magento 2.4.4 (PHP 8.1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 exception(s): | |
Exception #0 (Exception): Deprecated Functionality: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/vendor/bsscommerce/product-label/Helper/Data.php on line 147 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Helper/Data.php b/Helper/Data.php | |
index 28b2cc6..b840f3e 100644 | |
--- a/Helper/Data.php | |
+++ b/Helper/Data.php | |
@@ -131,22 +131,21 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper | |
*/ | |
public function isNotDisplayOn() | |
{ | |
- $display = $this->scopeConfig->getValue( | |
+ return (string) $this->scopeConfig->getValue( | |
'productlabel/general/not_display_label_on', | |
\Magento\Store\Model\ScopeInterface::SCOPE_STORE | |
); | |
- return $display; | |
} | |
/** | |
- * @param \Bss\ProductLabel\Model\Config\Source\PageDisplayLabel $page | |
+ * @param string $page | |
* @return bool | |
*/ | |
- public function isSystemConfigAllow($page) | |
+ public function isSystemConfigAllow(string $page): bool | |
{ | |
$pos = strpos($this->isNotDisplayOn(), $page); | |
- return ( ($this->isEnable() == true) && ($pos === false) ); | |
+ return $this->isEnable() === true && $pos === false; | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment