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

trim(): Passing null to parameter #1 ($string) of type string is deprecated #14

Closed
Detzler opened this issue Jan 13, 2023 · 2 comments
Closed

Comments

@Detzler
Copy link

Detzler commented Jan 13, 2023

php8.1

Exception #0 (Exception): Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/swissup/module-core/Plugin/SetEmptyStringIfOutputEmpty.php on line 18

Exception #0 (Exception): Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/swissup/module-core/Plugin/SetEmptyStringIfOutputEmpty.php on line 18
<pre>#1 trim() called at [vendor/swissup/module-core/Plugin/SetEmptyStringIfOutputEmpty.php:18]
#2 Swissup\Core\Plugin\SetEmptyStringIfOutputEmpty->afterToHtml() called at [vendor/magento/framework/Interception/Interceptor.php:146]
#3 Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#4 Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist\Interceptor->___callPlugins() called at [generated/code/Magento/Wishlist/Block/Catalog/Product/ProductList/Item/AddTo/Wishlist/Interceptor.php:527]
#5 Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist\Interceptor->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#6 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
@vovayatsyuk
Copy link
Member

The weird part is that toHtml method should return a string. Do you know why it returns null in your case?

@Detzler
Copy link
Author

Detzler commented Jan 13, 2023

@vovayatsyuk @0m3r men you're fast.

Do you know why it returns null in your case?

No, I don't recognize the cause. Here is the full strack trace. Maybe a 3rd party thing. Errors appear on category and product pages.

1 exception(s):
Exception #0 (Exception): Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/swissup/module-core/Plugin/SetEmptyStringIfOutputEmpty.php on line 18

Exception #0 (Exception): Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/swissup/module-core/Plugin/SetEmptyStringIfOutputEmpty.php on line 18
<pre>#1 trim() called at [vendor/swissup/module-core/Plugin/SetEmptyStringIfOutputEmpty.php:18]
#2 Swissup\Core\Plugin\SetEmptyStringIfOutputEmpty->afterToHtml() called at [vendor/magento/framework/Interception/Interceptor.php:146]
#3 Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#4 Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist\Interceptor->___callPlugins() called at [generated/code/Magento/Wishlist/Block/Catalog/Product/ProductList/Item/AddTo/Wishlist/Interceptor.php:527]
#5 Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist\Interceptor->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#6 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#7 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#8 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#9 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#10 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:511]
#11 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [vendor/magento/module-catalog/Block/Product/ProductList/Item/Container.php:33]
#12 Magento\Catalog\Block\Product\ProductList\Item\Container->getChildHtml() called at [generated/code/Magento/Catalog/Block/Product/ProductList/Item/Container/Interceptor.php:23]
#13 Magento\Catalog\Block\Product\ProductList\Item\Container\Interceptor->getChildHtml() called at [vendor/magento/module-catalog/view/frontend/templates/product/list.phtml:129]
#14 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#15 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#16 Magento\Framework\View\Element\Template->fetchView() called at [generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor.php:392]
#17 Magento\Catalog\Block\Product\ListProduct\Interceptor->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#18 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#19 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#20 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#21 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#22 Magento\Catalog\Block\Product\ListProduct\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#23 Magento\Catalog\Block\Product\ListProduct\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#24 Magento\Catalog\Block\Product\ListProduct\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor.php:617]
#25 Magento\Catalog\Block\Product\ListProduct\Interceptor->toHtml() called at [vendor/weltpixel/module-google-tag-manager-free/Block/Category.php:21]
#26 WeltPixel\GoogleTagManager\Block\Category->getProductCollection()
#27 call_user_func_array() called at [vendor/magento/framework/View/TemplateEngine/Php.php:94]
#28 Magento\Framework\View\TemplateEngine\Php->__call() called at [vendor/weltpixel/module-google-tag-manager-free/view/frontend/templates/category.phtml:8]
#29 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#30 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#31 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#32 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#33 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#34 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#35 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/weltpixel/module-google-tag-manager-free/Helper/Data.php:415]
#36 WeltPixel\GoogleTagManager\Helper\Data->addCategoryPageInformation() called at [vendor/weltpixel/module-google-tag-manager-free/Helper/Data.php:347]
#37 WeltPixel\GoogleTagManager\Helper\Data->getDataLayerScript() called at [vendor/weltpixel/module-google-tag-manager-free/Observer/CoreLayoutRenderElementObserver.php:40]
#38 WeltPixel\GoogleTagManager\Observer\CoreLayoutRenderElementObserver->execute() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:88]
#39 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:74]
#40 Magento\Framework\Event\Invoker\InvokerDefault->dispatch() called at [vendor/magento/framework/Event/Manager.php:65]
#41 Magento\Framework\Event\Manager->dispatch() called at [generated/code/Magento/Framework/Event/Manager/Proxy.php:95]
#42 Magento\Framework\Event\Manager\Proxy->dispatch() called at [vendor/magento/framework/View/Layout.php:518]
#43 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#44 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:511]
#45 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [vendor/magento/module-theme/view/frontend/templates/html/container.phtml:7]
#46 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#47 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#48 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#49 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#50 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#51 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#52 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Result/Page.php:253]
#53 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#54 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#55 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#56 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magezon/Core/Plugin/View/Result/Layout.php:24]
#57 Magezon\Core\Plugin\View\Result\Layout->aroundRenderResult() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#58 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#59 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:95]
#60 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#61 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#62 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#63 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants