WordPress.org

Support

Support » Plugins and Hacks » [Plugin: BackWPup] When mailing – [WARNING] date() expects parameter 2 to be long, string given

[Plugin: BackWPup] When mailing – [WARNING] date() expects parameter 2 to be long, string given

  • Note: using version 1.3.6

    When mailing an archive, the log shows this…

    2010-10-18 13:19.51: Creating mail
    2010-10-18 13:19.51: [WARNING] date() expects parameter 2 to be long, string given
    2010-10-18 13:19.51: [WARNING] date() expects parameter 2 to be long, string given
    2010-10-18 13:19.51: [WARNING] date() expects parameter 2 to be long, string given
    2010-10-18 13:19.51: [WARNING] date() expects parameter 2 to be long, string given
    2010-10-18 13:19.51: [WARNING] date() expects parameter 2 to be long, string given
    2010-10-18 13:19.51: Adding Attachment to mail

    Looking at the code, the warning occurs on line 1031 when formatting the subject of the email…

    $phpmailer->Subject = __(‘BackWPup File from’,’backwpup’).’ ‘.date_i18n(‘Y-m-d H:i’,$this->job[‘starttime’]).’: ‘.$this->job[‘name’];

    ‘starttime’ is set on line 189….

    $jobs[$this->jobid][‘starttime’]=current_time(‘timestamp’); //set start time for job

    The problem is the starttime is assigned to the $jobs array – but the mailing accesses the $this->job array.

    A workaround I did that resolves the issue (so the email subject has the starttime & no warning is reported to the log) is to change the starttime assignment to also assign to $this->job…

    $this->job[‘starttime’] = $jobs[$this->jobid][‘starttime’]=current_time(‘timestamp’); //DTC //set start time for job

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m getting the same warning.

    mamouneyya
    Member

    @mamouneyya

    The same thing here. It was working good before upgrading to 3.0.2.

    mamouneyya
    Member

    @mamouneyya

    Oops, I thought that this is just a bug report and didn’t notice that you provided a workaround. Thanks, it works for me, too!

    Pieter Hartsook
    Participant

    @hartsook

    I also didn’t realize the work-around patch was there at the bottom of your post. As a noobie it took me a bit of poking around to find the file to edit in the plugins/backwpup/apps/ folder, but found the referenced code in the backwpup_dojob.php file on line 189.

    It also was not clear if I was supposed to add the two lines of code or replace the referenced line 189. I just add the code starting right after line 189,

    $this->job[‘starttime’] = $jobs[$this->jobid]
    [‘starttime’]=current_time(‘timestamp’); //DTC //set start time for job

    Saved the file, ran the job and voila, no error!

    Thanks for the fix. It would be nice to get this into a plugin update ASAP though.

    Asis Rodriguez
    Member

    @asis-rodriguez

    yes please, it is a fear to see this warning in the logs- please, fix it.
    thanks
    Asis

    Plugin Author Daniel Hüsken
    Participant

    @danielhuesken

    fixed in next version.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: BackWPup] When mailing – [WARNING] date() expects parameter 2 to be long, string given’ is closed to new replies.