[buddypress-trac] [BuddyPress Trac] #6587: DATA BASE ERROR WHEN ADD notification
buddypress-trac
noreply at wordpress.org
Wed Aug 12 17:25:28 UTC 2015
#6587: DATA BASE ERROR WHEN ADD notification
--------------------------+-----------------------------
Reporter: chicho1969 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: API | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
Trying for weeks... WP 3.9.2 BuddyPress 2.3.2.1
function setup_globals( $args = array() ) {
global $bp;
$sr_notifications_test_slug = 'sr_notifications_test';
parent::setup_globals( array(
'id' => 'sr_notifications_test',
'slug' => $sr_notifications_test_slug,
'notification_callback' => array( $this, 'sr_format_notifications_test' )
) );
// Register this in the active components array
$bp->active_components[$sr_notifications_test_slug] =
'sr_notifications_test';
// do_action( 'setup_globals' );
}
//format notofication
function sr_format_notifications_test( $action, $item_id,
$secondary_item_id, $total_items, $format = 'string' ) {
switch ( $action ) {
case 'my_test':
$link = get_permalink( $item_id );
$text = 'Test Notification';
$return = apply_filters( $filter, array(
'text' => $text,
'link' => $link
), $link, (int) $total_items, $text, $link, $item_id, $secondary_item_id
);
break;
}
do_action( 'sr_format_notifications_test', $action, $item_id,
$secondary_item_id, $total_items );
return $return;
}
//Notification added to DB:
bp_notifications_add_notification( array(
'user_id' => $user_id,
'item_id' => $activity->id,
'secondary_item_id' => $activity->user_id,
'component_name' => buddypress()->activity->id,
'component_action' => 'my_test',
'date_notified' => bp_core_current_time(),
'is_new' => 1
) );
I try so many ways but afterall i have always the same error:
WordPress database error: [Table 'my_wp_db.n' doesn't exist]
SELECT * FROM n WHERE component_name IN ('activity') AND component_action
IN ('my_test') AND is_new = 1
WordPress database error: [Incorrect table name '']
INSERT INTO ``
(`user_id`,`item_id`,`secondary_item_id`,`component_name`,`component_action`,`date_notified`,`is_new`)
VALUES (0,0,0,'activity','my_test','2015-08-12 16:58:14',1)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6587>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list