WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
[resolved] Random post favorited even though empty (2 posts)

  1. emile.swain
    Member
    Posted 9 months ago #

    Across a number of wordpres versions. Happend during an update i recon.

    I had a post that wouldn't go away in the list of your favorited posts using the widget.

    After poking around in the sql i was able to resolve it. So this may have just been an update bug.

    Either way, to remove the erroneous post i deleted the wpfp_favorite entries in the wp_postmeta. I deleted all references as i only had a couple of bookmarks. If you had a large active database you'd probably have to narrow it down.

    I used two sql queries on my database.

    mysql> select * from  wp_postmeta where meta_key='wpfp_favorites';
    mysql> delete from wp_postmeta where meta_key='wpfp_favorites';

    Note that i don't think this is strictly an issue with wpfp, but rather an issue arising out of updating a whole load of stuff. Either way this is a solution.

    Output

    mysql> select * from  wp_postmeta where meta_key='wpfp_favorites';
    +---------+---------+----------------+------------+
    | meta_id | post_id | meta_key       | meta_value |
    +---------+---------+----------------+------------+
    |     480 |      39 | wpfp_favorites | 0          |
    |     494 |     148 | wpfp_favorites | 0          |
    |     609 |     255 | wpfp_favorites | 0          |
    |     687 |     374 | wpfp_favorites | 0          |
    |    3035 |     367 | wpfp_favorites | 0          |
    |    3739 |      36 | wpfp_favorites | 0          |
    |    4591 |     431 | wpfp_favorites | 0          |
    |    4592 |     112 | wpfp_favorites | 0          |
    |    4593 |     176 | wpfp_favorites | 1          |
    |    4594 |    1654 | wpfp_favorites | 0          |
    +---------+---------+----------------+------------+
    mysql> delete from wp_postmeta where meta_key='wpfp_favorites';
    Query OK, 10 rows affected (0.02 sec)

    After which everything worked ok again. Note that post 112 was the one that showed up.

    mysql> select * from wp_usermeta where meta_key='wpfp_favorites';
    +----------+---------+----------------+----------------------+
    | umeta_id | user_id | meta_key       | meta_value           |
    +----------+---------+----------------+----------------------+
    |      601 |       3 | wpfp_favorites | a:1:{i:0;s:3:"176";} |
    +----------+---------+----------------+----------------------+

    http://wordpress.org/plugins/wp-favorite-posts/

  2. emile.swain
    Member
    Posted 8 months ago #

    My Bad,
    I'd rather foolishly forgotten that i'd used a custom query and not the favourites widget to display my posts. As such i got caught out by passing in the favourites array of favourites into a custom WP_query without passing the ignore_sticky_posts = true parameter.

    Had me totally flummoxed. No bug here

Reply

You must log in to post.

About this Plugin

About this Topic