BP_Activity_Component object appears to be missing $table_name. Anyone know why?
-
I’ve been getting weird errors when trying to log an activity item via
bp_activity_add()
:WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '( user_id, component, type, action, content, primary_link, date_recorded, item_i' at line 1 for query INSERT INTO ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( 3163, 'members', 'new_member', '', '', '', '2015-07-16 15:47:00', 0, 0, 0, 0 ) made by require('wp-blog-header. php'), require_once('wp-load.php'), require_once('/srv/www/commons/current/web/wp-config. php'), require_once('wp-settings.php'), include('/themes/tuileries/functions.php'), bp_activity_add, BP_Activity_Activity->save
As you can see, there’s no table name here. It should be
INSERT INTO wp_bp_activities...
or thereabouts. It looks likeBP_Activity_Activity->save()
is trying to access$bp->activity->table_name
, but$bp->activity
doesn’t have atable_name
property at this stage. Instead, this is all that is in$bp->activity
:BP_Activity_Component Object ( [name] => Activity Streams [id] => activity [slug] => [has_directory] => [path] => /srv/www/commons/current/web/app/plugins/buddypress/ [query] => [current_id] => [notification_callback] => [admin_menu] => [search_string] => [root_slug] => [meta_tables] => Array ( ) [global_tables] => Array ( ) [adminbar_myaccount_order] => 10 )
Why isn’t there a table name here? How can I fix this?
- The topic ‘BP_Activity_Component object appears to be missing $table_name. Anyone know why?’ is closed to new replies.