Optimize your Joomla! 1.5 component installer

Most developers know that a component can have an install.componentname.php, containing a com_install() function with your custom instructions. For example, copying files to different locations or inserting localized sample data. When these instructions fail, you can of course print a message about that. The result however, is that the user sees both your ‘Failed’ message, as well as Joomla!’s ‘Success’ message. Users find this is very confusing.

The solution is actually extemely simple: inside com_install(), you need to return false. This tells the installer that your custom script has failed, and a relevant error message will be displayed. There is an added benefit as well: the installer will perform a rollback, removing all the files in the process.

By the way: I’m blogging live from the Joomlatools Bug Squashing event in Brussels!

Up next

How to link to a page in a pdf file.

How to link to a given page in a PDF file when rendered in the browser.

Read more →

Switching from WordPress to Joomla and setting up a document repository

Demistifying the switch from WordPress to Joomla and DOCman

Read more →

How Meltdown and Spectre affects your Joomla site

Here's what we learned so far about the Meltdown and Spectre vulnerabilities.

Read more →