• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

An error has occurred with a eval'd field - please inform the web-site owner. Debug: Eval except

ontarget

Active Member
Hi I was reading this thread and the wiki http://fabrikar.com/forums/index.php?wiki/common-php-tasks/#update and I believe I have the same issue but wanted to confirm if it was due to code deprecation
http://fabrikar.com/forums/index.php?threads/list-plugin-erros.46427/
Im using F3.7 and J3.8
Code:
// Adds a Attended button for list

$item = $model->getTable();
$app = JFactory::getApplication();
$ids = $app->input->get('ids', array(), 'array');
$db = FabrikWorker::getDbo();
$tr_table = $db->quoteName('course_registrants');
$c_id = $db->quoteName('id');
$claim_approved = $db->quoteName('claim_approved');
$timestamp = $db->quoteName('approved_timestamp');
$date=new DateTime(); //this returns the current date time
$time = $date->format('d/m/Y');

foreach ($ids AS $myid)  
{ 
    $row = $model->getRow($myid);
    $complete = $row->course_registrants___complete;
    $comp = explode('"',$complete);
    $compV = $comp[1];
    if ($compV == 1) {
  
      $db =& JFactory::getDBO();   
      $query = "SELECT cr.teacher_email, cr.team_leader_email, cs.full_course_name
                FROM course_registrants AS cr
                INNER JOIN courses AS cs
                ON cr.course = cs.id
                WHERE cr.id = $myid
              ";
      $db->setQuery($query);
      $result = $db->loadObject();
      $tl_email = $result->team_leader_email;
 
      $headers = "From: $tl_email";
      $email = $result->teacher_email;
      $subject = "Claim Approved";
      $msg = "Your claim has been approved by your Team Leader for course $result->full_course_name.\n
             Regards,\n
             \n
             ----------------------\n
             Login to to view your claims";
      mail($email,$subject,$msg,$headers);
    
      $q = "UPDATE $tr_table SET $claim_approved = 1, $timestamp = \"$time\" WHERE $c_id = $myid";
      $db->setQuery($q);
      $db->execute();
    
    }
  
}
 
You need F3.8 for J!3.8 (but I don't think this is the problem here).

As you can see in the thread you mentioned:
$db =& JFactory::getDBO();
Should be
$mydb =JFactory::getDbo();
(and then $mydb->xyz)
 
Thanks for the quick reply Troester - yes you're right i have j!3.7.5.
I will put in the amendments and revert.
 
Also instead of just using mail(), which will just use the (very unreliable) built in PHP mail() function, best to use ...

Code:
FabrikWorker::sendMail($tl_email, $tl_email, $email, $subject, $msg, true);

You could replace the second arg with the senders name, if you want.

The last arg (true) tells the function to send HTML formatted email, you could change that to false.

By using the sendMail() helper, it'll then go through Joomla's mail API, and you can then set that to use an SMTP relay for reliability.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top