WordPress.org

Ready to get started?Download WordPress

Forums

BackWPup Free - WordPress Backup Plugin
[Plugin: BackWPup] When mailing - [WARNING] date() expects parameter 2 to be long, string given (7 posts)

  1. dtclark
    Member
    Posted 3 years ago #

    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

  2. Pieter Hartsook
    Member
    Posted 3 years ago #

    I'm getting the same warning.

  3. mamouneyya
    Member
    Posted 3 years ago #

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

  4. mamouneyya
    Member
    Posted 3 years ago #

    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!

  5. Pieter Hartsook
    Member
    Posted 3 years ago #

    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.

  6. Asis Rodriguez
    Member
    Posted 3 years ago #

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

  7. Daniel Hüsken
    Member
    Plugin Author

    Posted 3 years ago #

    fixed in next version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags