Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reminder emails still going out 1 hour later than it should on 7.5.3 for me #1279

Closed
heratech opened this issue Apr 24, 2016 · 0 comments
Closed
Labels
Type: Bug Bugs within the core SuiteCRM codebase

Comments

@heratech
Copy link

heratech commented Apr 24, 2016

Reminder emails still going out 1 hour later than it should on 7.5.3 for me

This is from the cron log after I added a bunch of echo statements (at bottom) to the getUnsentEmailReminders() in Reminder.php

See below. The log is from after the event (1:30pm). The reminder should have been 1:15pm. Instead the reminder is set to go out at 2:15pm. The remidner does send at 2:15pm.

My php.ini date timezone for CLI and FPM is set to Europe/London. In the database the event is stored in UTC (12:15pm). Am using Nginx and FPM. System time is Europe/London. Date and Time are correct.

I upgraded from 7.3 to 7.4 to 7.5.3
This issue was meant to be fixed - see similar issues below. Maybe it is only happening to me? if so, any ideas?

#822
#811
#766

reminder bean:d0e53434-37c9-5310-95f2-571cb8321179
event bean:SundayTest2
event bean:24-04-2016 01:30pm
time:1461501000
datestart2016-04-24 13:30:00
globals timedate: Sun, 24 Apr 2016 13:30:00 +0000
event bean:24-04-2016 01:30pm
NOW_TS:Sunday 24th of April 2016 01:37:01 PM
REMIND_TS:Sunday 24th of April 2016 02:15:00 PM

private static function getUnsentEmailReminders()
{
    global $db;
    $reminders = array();
    $reminderBeans = BeanFactory::getBean('Reminders')->get_full_list('', "reminders.email = 1 AND reminders.email_sent = 0");
    if (!empty($reminderBeans)) {
        foreach ($reminderBeans as $reminderBean) {
            $eventBean = BeanFactory::getBean($reminderBean->related_event_module, $reminderBean->related_event_module_id);
            $dateStart = $eventBean->date_start;
            $time = strtotime($db->fromConvert($dateStart, 'datetime'));
            $dateStart = date(TimeDate::DB_DATETIME_FORMAT, $time);
            $remind_ts = $GLOBALS['timedate']->fromDb($db->fromConvert($dateStart, 'datetime'))->modify("-{$reminderBean->timer_email} seconds")->ts;
            //$alternate_remind_ts = $db->fromConvert($dateStart, 'datetime')->modify("-{$reminderBean->timer_email} seconds")->ts;
            $now_ts = $GLOBALS['timedate']->getNow()->ts;
            //if($eventBean->name == "TEST78910"){
            echo "_______________"."\r\n";
            echo "reminder bean:".$reminderBean->id."\r\n";
            echo "event bean:".$eventBean->name."\r\n";
            echo "event bean:".$eventBean->date_start."\r\n";
            echo "time:".$time."\r\n";
            echo "datestart".$dateStart."\r\n";
            echo "globals timedate: ".$GLOBALS['timedate']->fromDb($db->fromConvert($dateStart, 'datetime'))."\r\n";
            echo "event bean:".$eventBean->date_start."\r\n";
            echo "NOW_TS:".date('l jS \of F Y h:i:s A',$now_ts)."\r\n";
            echo "REMIND_TS:".date('l jS \of F Y h:i:s A',$remind_ts)."\r\n";
            //echo "ALTERNATE REMIND_TS:".date('l jS \of F Y h:i:s A',$alternate_remind_ts)."\r\n";
            echo "_______________"."\r\n";
            if ($now_ts >= $remind_ts) {
                $reminders[$reminderBean->id] = $reminderBean;
            }
        }
    }
    return $reminders;
}
@mattlorimer mattlorimer added the Type: Bug Bugs within the core SuiteCRM codebase label Apr 28, 2016
mattlorimer added a commit that referenced this issue Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

3 participants