WordPress.org

Ready to get started?Download WordPress

Forums

WP Document Revisions
[resolved] Error: date() expects parameter 2 to be long, string given (3 posts)

  1. grex22
    Member
    Posted 2 years ago #

    I'm getting an error across the top of the admin screen on a fresh install of this plugin when visiting the Add New Document page. Error details are below:

    Warning: date() expects parameter 2 to be long, string given in {my actual path edited out}/wp-content/plugins/wp-document-revisions/wp-document-revisions.php on line 441

    Thoughts? Anyone have a fix for this?

    http://wordpress.org/extend/plugins/wp-document-revisions/

  2. grex22
    Member
    Posted 2 years ago #

    Hmm.. Well, I seem to have found a fix, but not positive if this is correct or not.

    I changed line 441 from:

    $post->post_date = date( 'Y-m-d H:i:s', get_post_modified_time( 'U', null, $postID ) );

    To:

    $post->post_date = date( 'Y-m-d H:i:s', (int)get_post_modified_time( 'U', null, $postID ) );

    Maybe the developer can weigh in?

  3. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    That's very odd. Would it be possible to capture the string it is returning? That function gets passed through mysql2date() which is specifically designed to format dates for the date() function.

    on line 440 or so, something like: var_dump( get_post_modified_time( 'U', null, $postID ) );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic