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

Get SEO and performance reports for your sites.

Open Joomlatools Dashboard and check out our brand new analysis tools.

Read more →

What are AMP pages and how do they work?

TEXTman 3.0 introduced AMP support for Joomla, learn what AMP pages are and how they help your website's mobile search engine results.

Read more →

DOCman 3.3 stable is available

DOCman 3.3 is here, bringing frontend search improvements, Google documents and tag manager goodies and a few bug fixes.

Read more →