Joomla Warning: Parameter 2 to frontpage()   23 comments

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 one.com, 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:

/includes/Cache/Lite/Function.php
(this solves the “Reference instead of value”-problem)
/includes/vcard.class.php
(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:
Code:
if(!function_exists(‘quoted_printable_encode’))

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

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

Get the mirrored fix file here, http://bitbrain.se/fix_joomla_10x_php_530.zip

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.)

Advertisement

Posted May 15, 2010 by maximilion in Web Design

Tagged with , , , , ,

23 responses to Joomla Warning: Parameter 2 to frontpage()

Subscribe to comments with RSS.

  1. Hello

    Thanks so much for the help,

    It has helped a lot

    Regards

  2. great fix. Its work fine on my web site.

  3. Thank you very much! I found the fix on the joomla site, but was unable to download the zip file with the fix. Luckily you’ve foreseen this and provided the zip!

  4. Muy útil la solución a este problema. Me sirvió de mucho.

    Muchas Gracias

  5. Thanks so much !!
    Resolví el problema rápidamente.
    Gracias Max.

    Fabián

  6. Worked on my site as well!

    Thank you!!

  7. Effective and fast solution, my site works again.

    Thank a lot.

    Jose

  8. Thanks for posting the zip files. Worked for the site!!

  9. Thank you for you files.

  10. Thank you for your thoughtfulness. I quickly found the old post without an attachment too and hoped it would be around somewhere — and here it is! :-)

  11. Tego właśnie mi było potrzeba! Dzięki wielkie za info jak zlikwidować ten błąd. Dzięki!! It works!

  12. Thanks you!

    Working great!

  13. danke!

  14. Hi,
    another thankful User, saved me downgrading and a lotof work!

  15. thanks a lot it really works! :D _\,,/

  16. Thank you..its works

  17. Excelente aporte.. Mil GRACIAS! He solucionado mi problema! =]

  18. A very simple solution to this problem (without any extra code):
    In Function.php file line 92
    replace this: $result = call_user_func_array(array($class, $method), $arguments);
    with $result = call_user_func_array(array($class, $method), &$arguments);
    In line 100 of the same file
    replace this: $result = call_user_func_array($target, $arguments);
    with : $result = call_user_func_array($target, &$arguments);

    the solution is very simple put ‘&’ before $arguments.

  19. Grandioso.., muchas gracias

  20. My site is worked. Thanks so much!

  21. Dude, you rock!!!!!

    You saved me a ton of time troubleshooting this thing. Thanks a ton. If you’re every out in Phoenix, I’ll buy you a beer! :-)

  22. Ottima soluzione!
    Grazie

  23. Wow, thank you for this post. He has rescued me…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.