Skip to content

I have a custom search function that just started having a bit of an issue with caching (I’m assuming)

I’m not sure when it started not working or if it ever worked. Helping a friend out with their website. I’m going to assume it was working at some point. I looked in the logs while refreshing the page and only got the error below.

Magento ver. 2.3.4
Opensource not commerce

<?php if (!empty($_product->getAttributeText('home_type'))) : ?><li><i class="fa-fw sl-home"></i> <?php echo __(ucwords($_product->getAttributeText('home_type'))); ?></li><?php endif; ?>

line 315 ^

[2023-11-30 20:59:10] main.CRITICAL: Warning: ucwords() expects parameter 1 to be string, array given in Module/SearchAll/view/frontend/templates/Search.phtml on line 315 {"exception":"[object] (Exception(code: 0): Warning: ucwords() expects parameter 1 to be string, array given in Module/SearchAll/view/frontend/templates/Search.phtml on line 315 at /vendor/magento/framework/App/ErrorHandler.php:61)"} []

enter image description here

It get stuck on this page showing no results and even if i close out my browser and open it back up when I navigate to that page again to search.. it’s still sitting on the “We’re sorry, an error has occurred while generating this content.

Local session issue with my browser perhaps? The only thing is it’s been reported my multiple users now.

Any idea how to fix the ucwords error and how to fix this issue with the page not refreshing the search page?