Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/27/2014 04:19:40 PM (10 years ago)
Author:
djpaul
Message:

Backport r8524 from trunk: 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)

Props boonebgorges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/bp-xprofile/bp-xprofile-classes.php

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