Skip to content
Eduardo Lira

JOOMLA · PHP

How to Fix Warning Error - PARAMETER 1 TO MODMAINMENUHELPER BUILDXML() EXPECTED TO BE A REFERENCE in Joomla

Learn how to fix the 'Warning - PARAMETER 1 TO MODMAINMENUHELPER::BUILDXML() EXPECTED TO BE A REFERENCE' error that occurs due to script incompatibility with PHP 5.3 or higher in Joomla.

Another post from my old blog here for you. Probably some tips got old or are already in related forums on the first pages of Google. But it costs nothing to share and keep some solutions always accessible. After migrating all old posts, I will start sharing more advanced things and of course, new solutions to problems in apps that many people use in web development.

The error message Warning: PARAMETER 1 TO MODMAINMENUHELPER::BUILDXML() EXPECTED TO BE A REFERENCE occurs due to the Joomla version that has scripts incompatible with PHP 5.3 or higher. It is necessary to perform only one change to solve this error.

Open the file helper.php ( This is the file path: /modules/mod_mainmenu/helper.php) with an online editor or on your computer. Haa, before, don’t forget to save a copy of the file as security.

Change the following line in the file from:

function buildXML(&$params)

to:

function buildXML($params)

See that we only removed the &(ampersand) from the parameter passing. With me this problem occurred on a server with PHP 5.3. If your host has an even more current version of the language, please inform if the tip is also useful for you or not.

Save the file edition, clear the browser cache and perform new tests.

Remembering that other script depreciation errors may occur, in this case the most indicated is to update the application to a more current and stable version, since good site hosts have as priority to keep the PHP and Mysql version always updated with stable versions in order to guarantee security and better performance.

Thx!

Revisited in November 2026

In the post I asked whether the tip worked on newer PHP versions. The answer: it holds from PHP 5.3 to 5.6. Starting with PHP 7.0, from 2015, Joomla 1.5 doesn’t even get that far, because it uses the mysql_* functions, which were removed from the language. Anyone who still has a site on that version needs a server with an old PHP, which is a security risk in itself, or a migration to a current Joomla version. The advice at the end of the post, to update the application, is still what solves it.

Who writes this

Eduardo Lira

Software developer in Rio de Janeiro. I started this blog in 2012, in technical support at a hosting company, writing down the fixes for the problems that came up every day. Today I work at Sofis Tecnologia, on critical healthcare systems and SQL Server database migrations.

Found a mistake in this post?

A command that no longer works, a broken link, wrong information: tell me what you saw. The message goes only to the author and is not shown on the site.