saguaros
I've found this code where the issue might be. The specific function call is this:
count($this->item->tags->itemTags)
Possible fix
It works if we add tags to the featured article, it seems like php 8.0 is more strict when it comes to using the count() function retrieves NULL when no tags are applied to the article.
Here is the full code block (path: /templates/gk_portfolio/html/com_content/featured/default.php).
<?php if(count($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render(array('tags' => $this->item->tags->itemTags, 'class' => 'item__info')); ?>
<?php endif; ?>
This is the stacktrace.
#
#<?php die('Forbidden.'); ?>
#Date: 2023-03-19 13:43:23 UTC
#Software: Joomla! 4.2.9 Stable [ Uaminifu ] 14-March-2023 15:00 GMT
#Fields: datetime priority clientip category message
2023-03-19T13:43:23+00:00 CRITICAL 47.21.145.184 error Uncaught Throwable of type TypeError thrown with message "count(): Argument #1 ($value) must be of type Countable|array, null given". Stack trace: #0 [ROOT]/libraries/src/MVC/View/HtmlView.php(410): include()
#1 [ROOT]/templates/gk_portfolio/html/com_content/featured/default.php(45): Joomla\CMS\MVC\View\HtmlView->loadTemplate(NULL)
#2 [ROOT]/libraries/src/MVC/View/HtmlView.php(410): include('/var/www/client...')
#3 [ROOT]/libraries/src/MVC/View/HtmlView.php(203): Joomla\CMS\MVC\View\HtmlView->loadTemplate(NULL)
#4 [ROOT]/components/com_content/src/View/Featured/HtmlView.php(207): Joomla\CMS\MVC\View\HtmlView->display(NULL)
#5 [ROOT]/libraries/src/MVC/Controller/BaseController.php(639): Joomla\Component\Content\Site\View\Featured\HtmlView->display()
#6 [ROOT]/components/com_content/src/Controller/DisplayController.php(121): Joomla\CMS\MVC\Controller\BaseController->display(false, Array)
#7 [ROOT]/libraries/src/MVC/Controller/BaseController.php(672): Joomla\Component\Content\Site\Controller\DisplayController->display()
#8 [ROOT]/libraries/src/Dispatcher/ComponentDispatcher.php(143): Joomla\CMS\MVC\Controller\BaseController->execute('display')
#9 [ROOT]/components/com_content/src/Dispatcher/Dispatcher.php(56): Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()
#10 [ROOT]/libraries/src/Component/ComponentHelper.php(355): Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch()
#11 [ROOT]/libraries/src/Application/SiteApplication.php(208): Joomla\CMS\Component\ComponentHelper::renderComponent('com_content')
#12 [ROOT]/libraries/src/Application/SiteApplication.php(249): Joomla\CMS\Application\SiteApplication->dispatch()
#13 [ROOT]/libraries/src/Application/CMSApplication.php(294): Joomla\CMS\Application\SiteApplication->doExecute()
#14 [ROOT]/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute()
#15 [ROOT]/index.php(32): require_once('/var/www/client...')
#16 {main}