buddyboss-platform icon indicating copy to clipboard operation
buddyboss-platform copied to clipboard

profile or table_name_data is not defined

Open luizzz opened this issue 1 year ago • 0 comments

Describe the bug File: /src/bp-xprofile/classes/class-bp-xprofile-profiledata.php Error at line 248

To Reproduce Throw error when i try to update a profile (i think)

The variable $bp->profile->table_name_data is undefined or null here:

$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );

So, to fix this error, i made this:

$table = bp_core_get_table_prefix() . 'bp_xprofile_data'; $result = $wpdb->query( $wpdb->prepare( "UPDATE {$table} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );

luizzz avatar Jul 13 '23 16:07 luizzz