WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
Notice error when debug is turned on (9 posts)

  1. bensinclair
    Member
    Posted 3 years ago #

    I am getting the following notice error when I have debug turned on:

    Notice: Undefined index: postviews_id in /wordpress/wp-content/plugins/wp-postviews/wp-postviews.php on line 646

    Line 646 is currently set as:

    $post_id = intval($_GET['postviews_id']);

    To remove the notice error, it just needs to be changed to:

    $post_id = isset($_GET['postviews_id']) ? intval($_GET['postviews_id']) : 0;

    Hope that helps!

  2. bensinclair
    Member
    Posted 3 years ago #

    Found another one:

    Notice: Undefined index: views in /wordpress/wp-content/plugins/wp-postviews/wp-postviews.php on line 67

    Line 67:

    $post_views = intval($post_views['views'][0]);

    Should be:

    $post_views = isset($post_views['views'][0]) ? intval($post_views['views'][0]) : 0;

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Ok, so why did you tag this topic with wp-pagenavi?

  4. bensinclair
    Member
    Posted 3 years ago #

    Because the error is in the WP-Pagenavi plugin...

  5. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Mhm... so in what file and version of WP-PageNavi should I make the fixes you suggest?

  6. bensinclair
    Member
    Posted 3 years ago #

    Version 1.50 and in the /we-content/plugins/wp-postviews/wp-postviews.php

  7. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Ok, well, wp-postviews/wp-postviews.php is not part of the WP-PageNavi plugin, nor does WP-PageNavi have any integration with it.

  8. bensinclair
    Member
    Posted 3 years ago #

    LOL that would explain why you were confused at the start. My bad I'm sorry. Is there anyway for me to change the tag on this or will I have to repost?

  9. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    You should have an [x] next to the wp-pagenavi tag.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.