outeredge / magento-structured-data-module

Magento Structured Data Module by outer/edge
MIT License
46 stars 13 forks source link

PHP8.2 - Contact Us - Passing null to parameter #1 ($string) of type string is deprecated #50

Closed danielcbell closed 1 year ago

danielcbell commented 1 year ago

Exception #0 (Exception): Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /app/vendor/outeredge/magento-structured-data-module/Block/Contact.php on line 55

public function getStreetAddress() { return implode(', ', array_map('trim', [ $this->getConfig('general/store_information/street_line1'), $this->getConfig('general/store_information/street_line2') ])); }

Is fixed by:

public function getStreetAddress() { return implode(', ', array_map('trim', [ (string) $this->getConfig('general/store_information/street_line1'), (string) $this->getConfig('general/store_information/street_line2') ])); }

davidwindell commented 1 year ago

@danielcbell isn't this what the module is already doing? https://github.com/outeredge/magento-structured-data-module/blob/2da819904462b0fd800a14e1afc0b5910a5d4a32/Block/Contact.php#L53

Please ensure you are running the latest version.