How to show user error when installing Joomla! 1.6 - 1.7 components?

I am writing a setup script for Joomla! 1.7. How can I change the install()script section so that in case of failure I can show the user a well-formatted HTML error?

I am currently returning falsefrom a procedure install(), which leads to a cryptic error message:

Component Installation: Custom Installation Failure

The component.php file joomla/installer/adapters/component.phphas the following code, which makes me suspect that I cannot change the message abort().

if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'install')) 
{
     if ($this->parent->manifestClass->install($this) === false) {
          // Install failed, rollback changes
          $this->parent->abort(JText::_('JLIB_INSTALLER_ABORT_COMP_INSTALL_CUSTOM_INSTALL_FAILURE'));
          return false;
     }
  }

Decision

Before returning the error, I can raise an error that looks beautiful in the yellow box.

JError::raiseNotice(1, "Error Message <html code>");
return false;
+5
source share
1 answer

Decision

Before returning an error, I can raise an error that looks beautiful in the yellow box.

JError::raiseNotice(1, "Error Message <html code>");
return false;
0
source

All Articles