• Uncaught TypeError: Favorites.userFavorites is undefined

    `updateClearButtons /wp-content/plugins/favorites/assets/js/favorites.min.js?ver=2.3.2:1
    bindEvents /wp-content/plugins/favorites/assets/js/favorites.min.js?ver=2.3.2:1
    jQuery 7
    getFavorites /wp-content/plugins/favorites/assets/js/favorites.min.js?ver=2.3.2:1
    bindEvents /wp-content/plugins/favorites/assets/js/favorites.min.js?ver=2.3.2:1

    I do not know what this means of how to fix it, could anyone please advise?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I’ve the same issue on a website after testing update from version 4.9 to version 5.7.2 of WordPress.

    It doesn’t add the favorite in the database. When activating debug, javascript console shows:

    The favorite was successfully saved. favorites.js:569:14
    <unavailable> favorites.js:570:14

    The second line should show the data of the async http request, but it seems that something goes wrong.

    On the server side, I can see the request POST /wp-admin/admin-ajax.php which returns 200, but with an error (seen with tcpdump):

    {“status”:”error”,”message”:”Invalid post.”}

    However the postid requested does exist.

    Any idea what’s going on ?

    Found out the issue, the post types where not activated, so the function validates() didn’t allowed to add posts as favorites.

    And the thing is that with version 2.3.0 of Favorites plugin, it works as there is no validation process in app/Listeners/ while there is such validation process through the public function validates() with version 2.3.2.

    So it’s not a bug, you just have to set up the post type that should be “favoritable” 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Console Error on pages with button on’ is closed to new replies.