0
votes

I have installed a ticket module on my Joomla website, I get the following error when a ticket is submitted

Fatal error: Call to undefined method JRegistry::getValue() in /home/xboxfifa/public_html/HD/components/com_jtaghelpdesk/controller.php on line 300

function mailme($formData){
$version = new JVersion();
    $body = "A new inquiry has been recieved: <br /> Name : ". $formData['inqName']. "<br /> Email ID : ". $formData['inqEmail']. "<br/> Message : ".$formData['inqMessage'] ;
    $mailer =& JFactory::getMailer();
    $config =& JFactory::getConfig();
if($version->RELEASE==3.0)
{
    $recipient = array( 
    $config->get('mailfrom'),
    $config->get('fromname'));
}else
{
  $recipient = array( 
    $config->getValue( 'config.mailfrom' ),
    $config->getValue( 'config.fromname' ));
}
   $mailer->addRecipient($recipient);
   $subject=$formData['inqSubject']; 
   $mailer->setSubject($subject);
   $mailer->isHTML(true);
   $mailer->Encoding = 'base64';
   $mailer->setBody($body);
   $send =& $mailer->Send();  

   if ( $send !==true ) 
   {      $msg = 'Reply not Sent!';

   } else 
   {
       $msg = 'Reply Sent Successfully!';

   }

  }

If anyone could help me I would appreciate it.

2
What version of Joonla are you using?Lodder

2 Answers

3
votes

JRegistry::getvalue() was removed in Joomla 3.x so make sure you use JRegistry::get() instead.

As for your version compare, you should use this:

if (version_compare(JVERSION, '3.0.0', 'ge')){
    // code here
}
1
votes

Editing this answer because I realized the issue is something else. The problem here is the $version check you're doing looks for the release to be EXACTLY == 3.0. When really you want that get() method to be used for 3.0 and up. You should change your if-statement to:

if($version->RELEASE >= 3.0)
{ ... }

Because you're using 3.2.1 this will use the proper method gets for that version.