No Code Attached Yet PHP 8.x
avatar Stuartemk
Stuartemk
12 Nov 2021

Steps to reproduce the issue

When testing Joomla 4.0.4 with php 8.1 it gave the following errors in the frontend with the line

Call to a member function getTag() on null

in /home/test/public_html/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php (line 46)
$langTag = Factory::getApplication()->getLanguage()->getTag();

Error:
Call to a member function getTag() on null

at /home/test/public_html/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php:46
at Joomla\CMS\WebAsset\AssetItem\LangActiveAssetItem->__construct()
(/home/test/public_html/libraries/src/WebAsset/WebAssetRegistry.php:241)
at Joomla\CMS\WebAsset\WebAssetRegistry->createAsset()
(/home/test/public_html/libraries/src/WebAsset/WebAssetRegistry.php:424)
at Joomla\CMS\WebAsset\WebAssetRegistry->parseRegistryFile()
(/home/test/public_html/libraries/src/WebAsset/WebAssetRegistry.php:347)
at Joomla\CMS\WebAsset\WebAssetRegistry->parseRegistryFiles()
(/home/test/public_html/libraries/src/WebAsset/WebAssetRegistry.php:128)
at Joomla\CMS\WebAsset\WebAssetRegistry->get()
(/home/test/public_html/libraries/src/WebAsset/WebAssetManager.php:257)
at Joomla\CMS\WebAsset\WebAssetManager->useAsset()
(/home/test/public_html/libraries/src/WebAsset/WebAssetManager.php:225)
at Joomla\CMS\WebAsset\WebAssetManager->__call()
(/home/test/public_html/templates/cassiopeia/error.php:38)
at require('/home/test/public_html/templates/cassiopeia/error.php')
(/home/test/public_html/libraries/src/Document/HtmlDocument.php:771)
at Joomla\CMS\Document\HtmlDocument->_loadTemplate()
(/home/test/public_html/libraries/src/Document/HtmlDocument.php:830)
at Joomla\CMS\Document\HtmlDocument->_fetchTemplate()
(/home/test/public_html/libraries/src/Document/HtmlDocument.php:633)
at Joomla\CMS\Document\HtmlDocument->parse()
(/home/test/public_html/libraries/src/Document/HtmlDocument.php:652)
at Joomla\CMS\Document\HtmlDocument->render()
(/home/test/public_html/libraries/src/Document/ErrorDocument.php:140)
at Joomla\CMS\Document\ErrorDocument->render()
(/home/test/public_html/libraries/src/Error/Renderer/HtmlRenderer.php:77)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
(/home/test/public_html/libraries/src/Exception/ExceptionHandler.php:128)
at Joomla\CMS\Exception\ExceptionHandler::render()
(/home/test/public_html/libraries/src/Exception/ExceptionHandler.php:71)
at Joomla\CMS\Exception\ExceptionHandler::handleException()
(/home/test/public_html/libraries/src/Application/CMSApplication.php:311)
at Joomla\CMS\Application\CMSApplication->execute()
(/home/test/public_html/includes/app.php:63)
at require_once('/home/test/public_html/includes/app.php')
(/home/test/public_html/index.php:32)

And in the backend

in /home/test/public_html/libraries/vendor/joomla/session/src/Storage/NativeStorage.php (line 473)

Failed to start the session because headers have already been sent by "/home/test/public_html/libraries/src/Application/WebApplication.php" at line 355.

NativeStorage->start()
in /home/test/public_html/libraries/src/Session/Storage/JoomlaStorage.php (line 305)
$this->setId($session_clean); $cookie->set($session_name, '', time() - 3600); } } parent::start(); // Try loading data from the session if (isset($_SESSION['joomla']) && !empty($_SESSION['joomla'])) { $this->data = unserialize(base64_decode($_SESSION['joomla']));

RuntimeException:
Failed to start the session because headers have already been sent by "/home/test/public_html/libraries/src/Application/WebApplication.php" at line 355.

at /home/test/public_html/libraries/vendor/joomla/session/src/Storage/NativeStorage.php:473
at Joomla\Session\Storage\NativeStorage->start()
(/home/test/public_html/libraries/src/Session/Storage/JoomlaStorage.php:305)
at Joomla\CMS\Session\Storage\JoomlaStorage->start()
(/home/test/public_html/libraries/vendor/joomla/session/src/Session.php:405)
at Joomla\Session\Session->start()
(/home/test/public_html/libraries/vendor/joomla/session/src/Session.php:332)
at Joomla\Session\Session->has()
(/home/test/public_html/libraries/src/Session/Session.php:201)
at Joomla\CMS\Session\Session->get()
(/home/test/public_html/libraries/src/Factory.php:338)
at Joomla\CMS\Factory::getUser()
(/home/test/public_html/libraries/src/Application/AdministratorApplication.php:229)
at Joomla\CMS\Application\AdministratorApplication->getTemplate()
(/home/test/public_html/libraries/src/Error/Renderer/HtmlRenderer.php:47)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
(/home/test/public_html/libraries/src/Exception/ExceptionHandler.php:128)
at Joomla\CMS\Exception\ExceptionHandler::render()
(/home/test/public_html/libraries/src/Exception/ExceptionHandler.php:71)
at Joomla\CMS\Exception\ExceptionHandler::handleException()
(/home/test/public_html/libraries/src/Application/CMSApplication.php:311)
at Joomla\CMS\Application\CMSApplication->execute()
(/home/test/public_html/administrator/includes/app.php:63)
at require_once('/home/test/public_html/administrator/includes/app.php')
(/home/test/public_html/administrator/index.php:32)

Expected result

Actual result

System information (as much as possible)

Additional comments

avatar Stuartemk Stuartemk - open - 12 Nov 2021
avatar joomla-cms-bot joomla-cms-bot - change - 12 Nov 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Nov 2021
avatar PhilETaylor
PhilETaylor - comment - 13 Nov 2021

Does your cache folder exist? #21952

Are you sure your PHP 8 configuration has php-mysql installed and can access the mysql database?

Other references.
#34952 (comment)

#29590

avatar xillibit
xillibit - comment - 14 Nov 2021

Other references.
#34952 (comment)

I was reported the problem too, in this place above. In my case on 4.0.5-dev and Php 8.1.0-RC6, the directory cache is right here and i can access to phpmyadmin 5.1.1 i have some issues with it. I have right mysqli/pdo_mysql extensions loaded

avatar Quy Quy - change - 15 Jan 2022
Labels Added: ?
avatar Quy Quy - labeled - 15 Jan 2022
avatar joomdonation joomdonation - close - 13 Nov 2022
avatar joomdonation
joomdonation - comment - 13 Nov 2022

As of right now, Joomla 4 works well with PHP 8.1 (although there could be some still deprecated warnings in some part of our codes). Therefore, I'm closing this issue. If you still have this issue on a fresh latest Joomla 4 installation, feel free to re-open the issue and tell us exactly what we need to do to see the errors and we will check it further. Thanks !

avatar joomdonation joomdonation - change - 13 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-13 09:54:58
Closed_By joomdonation
Labels Added: PHP 8.x
Removed: ?

Add a Comment

Login with GitHub to post a comment