Skip to:

[Plugin: BP Profile Menu] Conflicting with BuddyPress Default Theme Cookies

  • mattryken


    The BuddyPress Default Theme uses a bp-activity-oldestpage cookie to keep track of which page is showing when the “more” button is pressed at the bottom of the activity feeds. When setting the bp-activity-oldestpage cookie the BuddyPress Default Theme uses the jquery cookie plugin and sets the path parameter to ‘/’.

    Here is an example from the BuddyPress Default Theme:
    jq.cookie(‘bp-activity-oldestpage’, 1, { path: ’/’ } );

    The “BP Profile Menu” plugin is also initializing the bp-activity-oldestpage cookie (along with some other buddypress cookies) in the bp-menus.js file but is not using the path parameter.

    The result is that two bp-activity-oldestpage cookies end up getting created causing unexpected results with the “more” button in the BuddyPress Default Theme. What happens is that when the “more” button is press the first time everything works as expected and the next set of results are returned, but if you then scroll down to the bottom of the activity feed again and press the “more” button the same set of results are returned as were returned the first time.

    I was able to fix the issue by patching the bp-menus.js file in the “BP Profile Menu” plugin, updating all calls that are setting cookies to have a path parameter of ‘/’.

    For example I updated:
    jQuery.cookie(‘bp-activity-oldestpage’, ‘1’);
    To Be:
    jQuery.cookie(‘bp-activity-oldestpage’, ‘1’, { path: ‘/’ });

    @modemlooper – I’m hoping you will consider making this update in an upcoming version. Thanks for the great plugin!

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

  • modemlooper


    fixed in 2.0.3



    @modemlooper – That fixed the specific issue that I outlined. I’m wondering if it would also make sense to add the { path: ‘/’ } parameter to all other cookies being set in the bp-menus.js file? Looking in the BuddyPress default theme’s _inc/global.js file I see bp-activity-scope cookie being set using the path parameter set to ‘/’. What do you think?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: BP Profile Menu] Conflicting with BuddyPress Default Theme Cookies’ is closed to new replies.
Skip to toolbar