I have developed a custom component for a client and they needed to be able to reuse email addresses for users. As Joomla required unique email addresses, I created a system plugin that fires on the "onAfterRoute" and loads my JTableUser class instead.
I know this isn't ideal but it was the best way to achieve the end result.
I have just installed Joomla 3.6 and it is now throwing a fatal error saying I cannot redeclare the JTableUser class when I try to use anything from the . I am guessing that the original class is now being called before the onAfterRoute trigger.
class PlgSystemMyComponentOverride extends JPlugin
{
public function __construct(&$subject, $config = array()) {
parent::__construct($subject, $config);
}
public function onAfterRoute() {
$app = JFactory::getApplication();
$option = JRequest::getCMD('option');
if('com_users' == JRequest::getCMD('option')) {
require_once('path_to_my_code.php');
}
}
}
Is there a way to fix this in Joomla 3.6?
Thanks
Lee
JRequest
is deprecated. Please have a look at the following answer to get the component view: joomla.stackexchange.com/a/4206/168