Category Archives: Web Design

Joomla Warning: Parameter 2 to frontpage()

There must be thousands of webdevs that have at one point installed Joomla 1.0.x on successful sites, where their hosts have upgraded PHP and SQL versions recently (and without notice!)

One of these is, though it would be improbable that they are the only hosts that frequently upgrade their server software surrupticiously.

This is fine, except that if a large number of devs use CMSes where the point is to not dev all the php yourself, a large number of websites can be made completely inoperable if there is a flaw in the php scripts of the CMS, or if server software upgrades are not backwards compatible.

In the case of Joomla 1.0.x, every single page on my company’s site failed to fetch articles from the Database. That’s right, zero content. :)

This was the error message from Joomla:

Warning: Parameter 2 to frontpage() expected to be a reference, value given in C:\xampp\htdocs\mambo\includes\Cache\Lite\Function.php on line 100

And this was the solution posted on Joomla forums: (All credit goes to Kjell Hählen.)

I wrote a fix. My version is Joomla 1.0.13 but I suppose it will not be very different for later versions.

You sould replace two files by the ones in the attachment:

(this solves the “Reference instead of value”-problem)
(to make the contact form work again)

If you rather add the changes by hand:
The changes to vcard.class.php are minor, look for:

In Function.php I added a this line twice:
$arguments = $this->fixCalls($arguments);

The new function (fixCalls) is added at the end of the file.

Get the mirrored fix file >> HERE <<

It turned out to be a simple fix, just changing a couple lines in two PHP scripts, in my case I used the fix zipfile. I’m blogging about it since files have a tendency to stop being hosted and forum posts get archived.

I can’t guarantee the fix will work for your site. But it saved a tricky upgrade path for me, and so I wanted to make sure the solution doesn’t get lost, folded, spindled or mutilated. :) (Kjell, if you don’t like this, let me know and I’ll take it down.)