Forum Replies Created
-
sigh, I found the problem….in theme template for BuddyBase, my line to require TEMPLATEPATH.”_inc/ajax.php” was commented out.
The phrase “did you plug it in” comes to mind
I think what happened was that while earlier working on the theme I had some problems with overlapping function calls and I commented it out to rsolve conflicting function re-defs. I later did a clean install of all my plugins etc, but forgot to actually start with a clean copy of BuddyBase (the theme itself).
I just tested and its working now, no problems :
Thanks for the tips, I’m a lot more familiar with WP innards now
Ok, so in the working default BuddyPress theme the Ajax handler works great:
bp_dtheme_post_update traceback:
#0 bp_dtheme_post_update() called at [:]
#1 call_user_func_array() called at
[wp-includes/plugin.php:395]#2 do_action() called at
[wp-content/plugins/buddypress/bp-core.php:2026]#3 bp_core_add_ajax_hook() called at [:]
#4 call_user_func_array() called at
[wp-includes/plugin.php:395]#5 do_action() called at
[wp-settings.php:298]#6 require_once(/home2/capacoac/public_html/artsbeta/wp-settings.php) called at
[wp-config.php:91]#7 require_once(/home2/capacoac/public_html/artsbeta/wp-config.php) called at
[wp-load.php:30]When doing a normal status update it seems to flow normally:
top of bp_dtheme_post_update in bp-theme-default…
. content=james
. object=
. calling bp_activity_post_update (no object)…
. calling user func tag=wp_default_stylesMy status update was “james”. So all working well for the default BuddyPress theme.
Now with BuddyBase activated none of that entire call chain happens and neither does it happen from the default buddy base theme. its like ajax.php is no longer being loaded.
To verify I put an error_log call at the top of the BuddyBase copy of _inc/ajax.php, just to indicate that _its_ version of ajax.php was being loaded…and its not. For some reason the BuddyBase theme is not having its version of ajax.php loaded.
I’m not really sure hwo to verify how the theme tells WordPress/BuddyPress to load that file, but I guess I have another lead to track down….
yeah, when I started looking through the wp hook, it became more clear that the bp-activity.php stuff is not the right place to look. It seems to get called for displaying the stream, not for updating it.
thanks for the tip, I’m going to go look at that now…
find . | xargs fgrep
./_inc/global.js
./_inc/ajax.php(basically the Ajax related code)
From the ajax code in BuddyBase theme, no hits not being invoked. So I went back to the BuddyPress plugin, and added some erro_log calls to bp-activity.php…that got his, so the Ajax frame work is working, just not connecting to the theme.
From the stack trace of bp-activity, it looks like wp-load.php leads to wp-settings.php, which loads up bp-loader.php…I imagine bp-loader.php is what brings in any necessary BuddyPress stuff.
Anyways, I confirmed that bp-activity.php (in the BuddyPress plugin, not the BuddyBase theme) is calling:
add_action( ‘wp’, ‘bp_activity_action_post_update’, 3 );
So the activity handler should be getting called…but it doesn’t. I put some logging in that function (bp_activity_action_post_update), and its not getting called.
The ‘wp’ hook seems like the place I would expect this to run; its Ajax so the theme/template isn’t actually needed, it just neesd th POST data. So the logic seems right.
At least the API reference says wp is used for POST processing:
https://codex.wordpress.org/Plugin_API/Action_Reference
I guess I need to dig around find where WordPress is invoking any wp hooks, and then try to see why its not invoking this POST handler.
I’m going to try this suggestion
{quote}
Brajesh Singh said 5 hours, 36 minutes ago:Hi,
Look for the post request. You will see some variable as action:”post_update” or something similar. Then look into your themes ajax.php(most probably in _inc/ajax.php) for a hook wp_ajax_{the action_name} , i.e. wp_ajax_post_update in this case. There will be a function attached to that. You can put your debug code in that function.
{quote}Cool, thank! I’m trying that now…