Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/15/2013 09:08:20 PM (11 years ago)
Author:
boonebgorges
Message:

Allow 0 to be stored in activitymeta

Previously, any value where empty( $value ) evaluated to true would result
in the deletion of the row. This change allows for 0 to be stored as a
legitimate value.

This is a stopgap until BP's meta functions are refactored to use WP's core
*_metadata() functions.

Fixes #5083

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/activity/functions.php

    r7570 r7576  
    103103
    104104    /**
     105     * @group bp_activity_update_meta
     106     * @ticket BP5083
     107     */
     108    public function test_bp_activity_update_meta_with_0() {
     109        $a = $this->factory->activity->create();
     110        $meta_value = 0;
     111
     112        bp_activity_update_meta( $a, '0_test', $meta_value );
     113
     114        $this->assertNotSame( false, bp_activity_get_meta( $a, '0_test' ) );
     115    }
     116
     117    /**
    105118     * @group bp_activity_get_user_mentionname
    106119     */
Note: See TracChangeset for help on using the changeset viewer.