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

  1. grex22
    Posted 4 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?


  2. grex22
    Posted 4 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 ) );


    $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
    Plugin Author

    Posted 4 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

  • WP Document Revisions
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic