404 error from joomla template after upgrade php version (8)

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
dnapas
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 31, 2023 2:06 pm

404 error from joomla template after upgrade php version (8)

Post by dnapas » Mon Jul 31, 2023 2:22 pm

I downloaded a free template from the internet, specifically this one:
https://diablodesign.eu/free-joomla-tem ... ersity-104

As you will notice it says that it is compatible with php 8.1.x.
When I started working on the site I upgraded from php 7.4 to php 8.x
however, I keep getting page 404 error, a custom page error from the template.

I contacted the provider who told me that the site can only work with php 7.4
I contacted the template maker and he said he knows the template doesn't work with php 8 but
he does not intend to upgrade it since it is joomla 3. However, in the relevant spot he writes different things and
he is not reliable.

Any advice welcome. If my provider upgrades to PHP 8 the site will be lost...
Last edited by toivo on Tue Aug 01, 2023 6:04 am, edited 1 time in total.
Reason: mod note: moved from 4.x Templates

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17445
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: 404 error from joomla template after upgrade php version (8)

Post by toivo » Tue Aug 01, 2023 6:42 am

Welcome to the Joomla forum!

dnapas wrote:
Mon Jul 31, 2023 2:22 pm
I upgraded from php 7.4 to php 8.x
however, I keep getting page 404 error, a custom page error from the template.
Confirmed. The template produces a 404 error at the front end when tested in Joomla 3.10.12 using PHP 8.0.13. An error log with the option Debug System does not give much information about the root cause:

Code: Select all

#Fields: datetime	priority clientip	category	message
2023-08-01T06:12:17+00:00	CRITICAL 127.0.0.1	error	Uncaught Throwable of type Error thrown. Stack trace: #0 [ROOT]\templates\dd_university_104\html\modules.php(52): renderTemplateFromIncludes('joomlaposition_...', Array)
#1 [ROOT]\templates\dd_university_104\html\modules.php(39): modChrome_block(Object(stdClass), Object(Joomla\Registry\Registry), Array)
#2 [ROOT]\libraries\src\Helper\ModuleHelper.php(262): modChrome_drstyle(Object(stdClass), Object(Joomla\Registry\Registry), Array)
#3 [ROOT]\libraries\src\Document\Renderer\Html\ModuleRenderer.php(98): Joomla\CMS\Helper\ModuleHelper::renderModule(Object(stdClass), Array)
#4 [ROOT]\libraries\src\Document\Renderer\Html\ModulesRenderer.php(47): Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render(Object(stdClass), Array, NULL)
#5 [ROOT]\libraries\src\Document\HtmlDocument.php(511): Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render('position-7', Array, NULL)
#6 [ROOT]\libraries\src\Document\HtmlDocument.php(803): Joomla\CMS\Document\HtmlDocument->getBuffer('modules', 'position-7', Array)
#7 [ROOT]\libraries\src\Document\HtmlDocument.php(577): Joomla\CMS\Document\HtmlDocument->_renderTemplate()
#8 [ROOT]\libraries\src\Application\CMSApplication.php(1112): Joomla\CMS\Document\HtmlDocument->render(false, Array)
#9 [ROOT]\libraries\src\Application\SiteApplication.php(778): Joomla\CMS\Application\CMSApplication->render()
#10 [ROOT]\libraries\src\Application\CMSApplication.php(231): Joomla\CMS\Application\SiteApplication->render()
#11 [ROOT]\index.php(49): Joomla\CMS\Application\CMSApplication->execute()
#12 {main}
IMHO, its better to find a different template for the migration, something that works both in Joomla 3 and Joomla 4 using PHP 8. Alternatively, use your new template in Joomla 3 with PHP 7.4 while you find out about different ways to make Cassiopeia do what you want in Joomla 4, testing the functionality for example in Wampserver, hosted in your workstation:
Cassiopeia Template
Cassiopeia Template – a bunch of Tips & Tricks
Tweak Cassiopeia with a top banner and horizontal navigation
Toivo Talikka, Global Moderator

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2910
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: 404 error from joomla template after upgrade php version (8)

Post by SharkyKZ » Tue Aug 01, 2023 7:06 am

really shady for the developer to advertise PHP 8.1 compatibility when it's clearly not supported. Start looking for a new template. In the meantime, you can fix the error by changing this line in functions.php:

Code: Select all

return call_user_func_array($name, $args);
to this:

Code: Select all

return call_user_func_array($name, array_keys($args));

dnapas
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 31, 2023 2:06 pm

Re: 404 error from joomla template after upgrade php version (8)

Post by dnapas » Tue Aug 01, 2023 5:06 pm

The change fix the error, thank you very much I appreciate all your answers.
Unfortunately all the modules deactivated. The rest are allright.
It was a big mistake to not migrate to joomla 4 before trust anyone in the internet. I am looking forward to do so.


Post Reply

Return to “Templates for Joomla! 3.x”