BP Errors and rtMedia 3.2.8


#1

Hi, if BuddyPress is enabled then when I activate rtMedia, I get it

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/x/public_html/x/wp-includes/functions.php on line 3060

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/x/public_html/x/wp-includes/functions.php:3060) in /home/x/public_html/x/wp-content/plugins/buddypress-media/app/main/controllers/media/RTMediaViewCount.php on line 20

My info are the followings

PHP 5.3.27 MYSQL 5.5.32 WordPress 3.7.1 BuddyPress 1.8.1 rtMedia 3.2.8 OS Linux Imagick Not Installed GD bundled (2.1.0 compatible) [php.ini] post_max_size 8M [php.ini] upload_max_filesize 100M [php.ini] memory_limit 256M Installed Plugins rtMedia for WordPress, BuddyPress and bbPress by rtCamp version 3.2.8, BuddyPress by The BuddyPress Community version 1.8.1,

Theme Name Twenty Twelve Theme Version 1.3

Template Overrides plugins/buddypress-media/templates/media/album-gallery-item.php, plugins/buddypress-media/templates/media/album-gallery.php, plugins/buddypress-media/templates/media/album-single-edit.php, plugins/buddypress-media/templates/media/media-gallery-item.php, plugins/buddypress-media/templates/media/media-gallery.php, plugins/buddypress-media/templates/media/media-single-edit.php, plugins/buddypress-media/templates/media/media-single.php, plugins/buddypress-media/templates/media/uploader.php Total Albums 1

Please note than if BP isn't enabled then nothing is displayed !

so, do you know why it happens? not seen it with your previous release

thanks for any idea and ;) way to fix it


#2

@dJe,
We are not able to reproduce the Notice regarding BuddyPress error.
Can you give the debug information, error log information and the exact line from where the notice thrown?

Regarding session notice, it will be fixed in the next release.


#3

Hi, thanks @riteshpatelrtcamp for your support but all my debug info 've been copy&paste above previously

May be the following logs could help you

WordPress database error Unknown column 'wp_bp_activity.item_id' in 'on clause' for query SELECT  
                                                    count(id)  
                                                FROM  
                                                    wp3_bp_activity left outer join (select distinct  
                                                            a.meta_value  
                                                        from  
                                                            wp3_postmeta a  
                                                                left join  
                                                            wp3_posts p ON (a.post_id = p.ID)  
                                                        where  
                                                            (NOT p.ID IS NULL)  
                                                                and a.meta_key = 'bp_media_child_activity') p  
							on  wp_bp_activity.item_id = p.meta_value  
                                                where  
                                                    type = 'activity_comment'  
                                                    and is_spam <>1 and  
                                                        not p.meta_value is NULL made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), call_user_func_array, RTMedia->admin_init, RTMediaMigration->__construct, RTMediaMigration->get_total_count  
WordPress database error Table 'my_db_name.wp3_rt_rtm_media' doesn't exist for query select count(*)  
                from wp3_rt_rtm_media where blog_id = 1 and media_id in (select a.post_id  
                from  
                    wp3_postmeta a  
                        left join  
                    wp3_postmeta b ON ((a.post_id = b.post_id)  
                        and (b.meta_key = 'bp_media_privacy'))  
                        left join  
                    wp3_postmeta c ON (a.post_id = c.post_id)  
                        and (c.meta_key = 'bp_media_child_activity')  
                        left join  
                    wp3_posts p ON (a.post_id = p.ID)  
                where  
                    a.post_id > 0 and  (NOT p.ID IS NULL)  
                        and a.meta_key = 'bp-media-key') made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), call_user_func_array, RTMedia->admin_init, RTMediaMigration->__construct, RTMediaMigration->get_done_count  

NB: changed db prefix wp_ by default at install’… wp3_


#4

Plese note than not encounter these alerts when using v3.2.7


#5

@dJe,
Thanks for bringing this SQL error to our notice. We checked it but it has nothing to do with BuddyPress notice.

This SQL errors will be fixed in next release.


#6

Ok, I tried quickly a fresh install on an other server and I didn’t encounter theses alerts :wink: it could be linked to my php configaration, isn’t ?

PS: I can show you my phpinfo, if needed

In fact I 've nothing to do :wink: only wait your next release ?


#7

@dje,
Can you check again if this issue occurs when BuddyPress is activated/deactivated.
It is actually difficult as we are not facing this kind of issue on our end.


#8

When BP is enabled and later rtMedia

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/x/public_html/x/wp-includes/functions.php on line 3060

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/x/public_html/x/wp-includes/functions.php:3060) in /home/x/public_html/x/wp-content/plugins/buddypress-media/app/main/controllers/media/RTMediaViewCount.php on line 20

If rtMedia is enabled firstly

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/x/public_html/x/wp-includes/functions.php on line 3060

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/x/public_html/x/wp-includes/functions.php:3060) in /home/x/public_html/x/wp-content/plugins/buddypress-media/app/main/controllers/media/RTMediaViewCount.php on line 20

Warning: Cannot modify header information - headers already sent by (output started at /home/x/public_html/x/wp-includes/functions.php:3060) in /home/x/public_html/x/wp-includes/pluggable.php on line 899


#9

PS: Activity upload doesn’t work, then the same alerts 're displayed (it work well from user profile)

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/x/public_html/x/wp-includes/functions.php on line 3060

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/x/public_html/x/wp-includes/functions.php:3060) in /home/x/public_html/x/wp-content/plugins/buddypress-media/app/main/controllers/media/RTMediaViewCount.php on line 20


#10

Strange :wink: but 2d test with activity uploader and files 're now uploaded (even if these 2 alerts above 're still displayed and there is a new one, also:
Notice: Undefined index: buddypress_limitOnActivity in /home/x/public_html/x/wp-content/plugins/buddypress-media/app/main/controllers/activity/RTMediaActivity.php on line 47


#11

@dJe,
Session notice and undefined buddypress_limitOnActivity has been fixed and will be available in next release.
Regarding the bp_setup_current_user notice, we are still looking into it and get it done.


#12

Well, thank you @riteshpatelrtcamp and :wink: good luck about this bp_setup_current_user notice


#13

With your latest version (3.2.9)

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/.../public_html/.../wp-includes/functions.php on line 3060

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/…/public_html/…/wp-includes/functions.php:3060) in /home/…/public_html/…/wp-content/plugins/buddypress-media/app/main/controllers/media/RTMediaViewCount.php on line 28

No way to fix it, even if :wink: core modification is needed ?


#14

@dje,
We are not able to reproduce session notice on our end. Could you logout and login again and check for the notice?


#15

hi,
I can confirm same error for both BuddyPress and bbPress
for BuddPress is related to bp_setup_current_user
for bbPress to bbp_setup_current_user

Please check for example bbPress latest version 2.5:
/bbpress/includes/core/sub-actions.php line 146
where they throw an error if you’re setting current user before the “init” action.

  
function bbp_setup_current_user() {  

	// If the current user is being setup before the "init" action has fired,  
	// strange (and difficult to debug) role/capability issues will occur.  
	if ( ! did_action( 'after_setup_theme' ) ) {  
		_doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'bbpress' ), '2.3' );  
	}  

	do_action( 'bbp_setup_current_user' );  
}  

So I suppose you’re setting current user somewhere too early.
Thx, regards
Andrea Fercia


#16

sorry forgot to mention both errors for me are “PHP Notice”.
Please check your error reporting level is set to all and you have set: define(‘WP_DEBUG’, true); in your wp-config.php


#17

Well, thank you @afercia for your support

I'm newbie, sorry, what means "error reporting level" and ;) please, could you tell me how to check/increase it ?

In fact I use the following parameters (WP codex example) `// Enable WP_DEBUG mode define('WP_DEBUG', true);

// Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings define('WP_DEBUG_DISPLAY', true); //false @ini_set('display_errors',0);

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define('SCRIPT_DEBUG', true); ` Nothing is recorded into this log file, these alerts/notices 're displayed at screen


#18

hi @dJe you can read more about PHP error reporting on the PHP documentation Your WP debug constants and the ini_set @ini_set('display_errors', 0); are the example from WordPress debug documentation and this configuration should hide all errors on the screen and generate a log file with errors. I've tried your same debug configuration and I get the notices in my debug.log, I really don't know why your log is empty. Maybe try to keep just define(‘WP_DEBUG’, true); to see errors on screen?

Btw, I've found the notices are generated by some stuff you hook to actions in your main class construct, there are 3 functions hooked to 'plugins_loaded' and as soon as I change add_action('plugins_loaded', array($this, 'admin_init')); in add_action('init', array($this, 'admin_init')); the notices disappear, though I really don't know how this would affect your plugin :) regards Andrea


#19

just noticed one thing. in the wp admin I can always see the error printed in every page but on the frontend just after I post a message in my Activity page, so please try to do the same: post a message and check for errors. See attached screenshot. Thx, regards

Attachment Link(s):

http://rtcamp.com/wp-content/uploads/rtMedia/topics/52153/2013/11/rtmedia-notices.png


#20

yep, I'm using WP doc. example but with the following parameter define(‘WP_DEBUG_DISPLAY’, true);

but you 're right, it seems than I 've so quickly checked WP root, not /wp-content folder ;-) where this log file is located in fact...

I 'll be back later, many thanks to you, Andrea @afercia for your suggestion, I 'll try to investigate about it