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 our enterprise hosting helped SBHPP get more leads

Read about how we helped SBHPP improve the performance of their website to get more leads

Read more →

How do I allow users to view but not download documents?

DOCman with Google Drive allows users to view but not download documents.

Read more →

TEXTman 2.1 - introducing image enhancements for your Joomla articles.

TEXTman 2.1 introduces a slew of file and image specific enhancements for your Joomla articles.

Read more →