Skip to:
Content

BuddyPress.org

Changeset 10214


Ignore:
Timestamp:
10/08/2015 05:21:52 AM (9 years ago)
Author:
r-a-y
Message:

bp-legacy: Only set activity cookies if they are not null.

When we upgraded jQuery.cookie to v1.4.1 in BuddyPress 2.1.0 (#5208),
null values now get set as cookies. Beforehand, the older version of
jQuery.cookie() did not set null values as a cookie.

This caused an issue on the Activity directory page where the correct tab
was not being selected due to the invalid cookie value.

Fixes #6143.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/js/buddypress.js

    r10150 r10214  
    19161916function bp_activity_request(scope, filter) {
    19171917    /* Save the type and filter to a session cookie */
    1918     jq.cookie( 'bp-activity-scope', scope, {
    1919         path: '/'
    1920     } );
    1921     jq.cookie( 'bp-activity-filter', filter, {
    1922         path: '/'
    1923     } );
     1918    if ( null !== scope ) {
     1919        jq.cookie( 'bp-activity-scope', scope, {
     1920            path: '/'
     1921        } );
     1922    }
     1923    if ( null !== filter ) {
     1924        jq.cookie( 'bp-activity-filter', filter, {
     1925            path: '/'
     1926        } );
     1927    }
    19241928    jq.cookie( 'bp-activity-oldestpage', 1, {
    19251929        path: '/'
Note: See TracChangeset for help on using the changeset viewer.