Yoast-SEO-for-Magento2 icon indicating copy to clipboard operation
Yoast-SEO-for-Magento2 copied to clipboard

Only get logo src when logo block actually exists

Open peterjaap opened this issue 6 years ago • 1 comments

We have a modified design for one of our clients and the logo block doesn't exist anymore. We now get this warning;

Fatal error: Uncaught Error: Call to a member function getLogoSrc() on boolean in /data/imaginerun/magento2/vendor/maxserv/magento-module-yoastseo/Block/Schema/Organization.php on line <i>44</i>

Due to this line; https://github.com/Yoast/Yoast-SEO-for-Magento2/blob/8c228d002f3b538438c211205f755638d955b5e9/Block/Schema/Organization.php#L24

It would be great to return null when the block doesn't exist like so

return $logoBlock ?  $logoBlock->getLogoSrc() : null;

peterjaap avatar Aug 29 '18 14:08 peterjaap

Same problem here !

choussamaster avatar Oct 25 '18 06:10 choussamaster