Skip to content

[2.5.20, Joomla 4] Call to undefined method Joomla\CMS\Factory::getXML() in template.php #191

@GHSVS-de

Description

@GHSVS-de
  • After migration Joomla 3.10.11 to 4.22.
  • PHP 7.4
  • Astroid 2.5.20
  • A JoomDev template that works without issues on Joomla 3.

In frontend I get a white page with error

0 Call to undefined method Joomla\CMS\Factory::getXML()
/libraries/astroid/framework/template.php:60

It comes from these lines (method templateVersion()): https://github.com/templaza/astroid-framework/blob/v2.5.20/framework/template.php#L58-L63

Background: Method JFactory::getXML() has been removed in Joomla 4. See https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4#Factory

Factory::getXml has been removed along with JXMLElement. Use SimpleXMLElement directly instead.

I haven't made further investigations yet but the method templateVersion() itself has a bug with Joomla 4.

Metadata

Metadata

Assignees

Labels

Joomla 4Related to Joomla 4

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions