Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/15/2014 06:02:40 PM (10 years ago)
Author:
boonebgorges
Message:

Improve the format of the "dummy" cached item in BP_XProfile_XProfileData::get_data_for_user()

When a value is not found for a given field/user pair, an empty piece of data
is stored in the cache to avoid an unnecessary requery. However, the value was
not being stored with the proper format, resulting in PHP notices in certain
cases (such as when fields were preloaded into the cache for 'select'/'option'
parent/child relationships)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-classes.php

    r8478 r8524  
    11911191                // to avoid future cache misses
    11921192                } else {
    1193                     $d           = new stdClass;
    1194                     $d->id       = '';
    1195                     $d->field_id = $field_id;
    1196                     $d->value    = '';
     1193                    $d               = new stdClass;
     1194                    $d->id           = '';
     1195                    $d->user_id      = '';
     1196                    $d->field_id     = $field_id;
     1197                    $d->value        = '';
     1198                    $d->last_updated = '';
    11971199
    11981200                    wp_cache_set( $field_id, $d, $cache_group );
Note: See TracChangeset for help on using the changeset viewer.