Scheduler Module goes Blank

I am using 7.10 on-demand and when i upload my module with module loader and install it my Scheduler goes blank and i can't see it until i uninstall it. I searched on this forum and some say that its because there is a logic flaw in my code. can someone point that out? thanks beforehand.

code:

function lftm_it_late_task_job() {

$builder = $GLOBALS['db']->getConnection()->createQueryBuilder();
$builder->select('id')
->from('tasks')
->where('deleted = 0')
->andwhere('DATE(NOW) > DATE_ADD(date_due, INTERVAL 1 HOUR)');

$stmt = $builder->execute();

foreach($stmt->fetchAll() as $row) {
$id = $row['id'];

$task = BeanFactory::retrieveBean('Tasks', $id, array('disable_row_level_security' => true));

if (isset($task) && isset($task -> id) && !empty($task -> id)) {

if($task->it_late_c != true) {
$task->it_late_c = true
}

}

}

return true
}

ps: it_late_c is a checkbox field

Parents
  • As a general rule, a blank page or 500 Error is a symptom of a PHP error.

    Check your php log.

    I cut and pasted your code in a php file, did a php -l on it and found that have a syntax error, missing a semi-colon:

    function lftm_it_late_task_job() {

    $builder = $GLOBALS['db']->getConnection()->createQueryBuilder();
    $builder->select('id')
    ->from('tasks')
    ->where('deleted = 0')
    ->andwhere('DATE(NOW) > DATE_ADD(date_due, INTERVAL 1 HOUR)');

    $stmt = $builder->execute();

    foreach($stmt->fetchAll() as $row) {
    $id = $row['id'];

    $task = BeanFactory::retrieveBean('Tasks', $id, array('disable_row_level_security' => true));

    if (isset($task) && isset($task -> id) && !empty($task -> id)) {

    if($task->it_late_c != true) {
    $task->it_late_c = true <===add semicolon here}

    }

    }

    return true
    }

    Just a side note, as an on-demand customer you should have access to a development copy of Sugar that you can install on your local machine so you can test and debug your code prior to deployment.

    HTH

    FrancescaS

  • Thank you very much. Where can I see the log (or debug module if it exists).

    Update: Sadly still doesn't work

Reply Children