PiTech 1.0.2 – Joomla 6 compatibility issue / JFactory error - Forum | JoomShaper
Staff replied Templates

PiTech 1.0.2 – Joomla 6 compatibility issue / JFactory error

Asked by Martin 2 weeks ago Last activity 2 weeks ago

Hi guys,

am I missing something here, or is it really true that JoomShaper has been shipping a buggy PiTech template package for months while explicitly listing it as compatible with Joomla 6?

Installing pitech-template-1.0.2.zip on a clean Joomla 6 installation reproducibly results in:

[code]
ClassNotFoundError

Attempted to load class "JFactory" from the global namespace.
Did you forget a "use" statement?
[/code]

The error comes from:

[code]
/templates/pitech/error.php
[/code]

Line 17:

[code]
$doc = JFactory::getDocument();
[/code]

JFactory is legacy code and is no longer available like this in Joomla 6.

I find this rather difficult to understand, especially since PiTech 1.0.2 is officially advertised as compatible with Joomla 6, 5 and 4.

On the positive and constructive side, for anyone else running into this problem:

In:

[code]
/templates/pitech/error.php
[/code]

change:

[code]
$doc = JFactory::getDocument();
[/code]

to:

[code]
$doc = $app->getDocument();
[/code]

There are also additional legacy Joomla calls in the template, including JFactory and JURI, so the package really could use a proper Joomla 6 cleanup instead of relying on backward compatibility.

After replacing the outdated calls, PiTech 1.0.2 runs fine under Joomla 6.

I would very much appreciate it if JoomShaper could update the official package accordingly — especially when it is explicitly labelled as Joomla 6 compatible.

3 replies

Ziaul Kabir Staff

Hi Martin,

Thank you for the detailed report and for sharing the workaround.

Could you please let us know which PHP version you are currently using on your Joomla 6 installation?

This information will help us reproduce and investigate the issue on our side.

Thanks!

Martin Asked this

PHP 8.3 und 8.4

Ziaul Kabir Staff

Please, share the url where you see this issues.

Thanks

Log in to reply.