Admin jQuery error on install "Uncaught TypeError: Object #…"
-
Hi all…
I’ve upgraded (by hand on command line) my install to 3.2.1
All is working fine except I get a .js error (in the console log) in the admin area “Uncaught TypeError: Object #<Object> has no method ‘swing'”This obviously refers to the JQ Easing script but unsure why it isn;t picking it up… any ideas?
Cheers
Rob
-
Same problem here.. did you figure out a fix?
I’m having the same problem. I have reinstalled wordpress and compared it with a fresh install. The fresh install (out of the box) doesn’t have this problem. I’m suspecting that this is a problem with a plugin.
Here are mine:
BuddyPress Template Pack
Version 1.0.2 | By apeatlingMailChimp
Version 1.2.4 | By MailChimp and Crowd FavoriteMailChimp Archives
Version 3.2 | By Mark ParolisiWordPress Popular Posts
Version 2.1.4 | By Héctor CabreraAkismet
Version 2.5.3 | By AutomatticAll in One SEO Pack
Version 1.6.13.2 | By Michael TorbertBuddyPress
Version 1.2.5.2 | By The BuddyPress CommunityBuddypress Sitewide activity widget
By Brajesh SinghDisable Admin Bar
Version 1.1 | By OzhEvents Calendar Pro
Version 1.2 | By Shane & Peter, Inc.Google Analytics for WordPress
Version 4.1 | By Joost de ValkJanrain Engage
Version 1.0.5 | By forestbLooks like buddypress is the culprit.
For me it turns out that Buddypress (1.2.8) causes this error.
Unfortunately I’m working on some core changes to Buddypress which means I can’t upgrade at the moment! That’s my own fault though of course.
It’s the new WP Admin menus that use ‘swing’ from jQuery Easing – did they before? I thought they were just a slide.
The “install plugins” drop down still works as it uses slide rather than swing.
That’s my research.
For mine, the BP template pack was the problem. I fixed it by modifying
bp-template-pack/bp-template-pack.phpline 35 if ( !is_admin() ) {
line 36 wp_enqueue_script( ‘bp-js’, BP_PLUGIN_URL . ‘/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ) );
line 37 }Ah OK – I don’t use that. Glad you sussed it for you.
Rob, I think whats important here is to disable the buddypress javascript when you are in the admin area.
Adding a is_admin() test allows me to keep buddypress global.js loaded on the front end of the website and keep it from loading in wp-admin. It’s useless in wp-admin anyway.
You’re right, wrapping for tests is a good idea (and quick!) – I have many more pages to break before I’m back on this. If I’m stuck I’ll be back!
@ chucklin72 Thanks for the tip. I edited the bp-template-pack.php file per you instructions and I can edit my widgets again. Yay! Thank you!
I had the same error, except without the bp-template-pack.php, my issue was from using the default buddypress theme. I adapted chucklin72’s fix into my buddypress theme’s function.php file.
seems a bit sloppy for buddypress not to use a hook for that, but this fixes the issue with modals not closing in admin anyway…
if ( !is_admin() ) { /* Load the AJAX functions for the theme */ require_once( TEMPLATEPATH . '/_inc/ajax.php' ); /* Load the javascript for the theme */ wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ) ); }Hi guys
I am using BuddyBase child theme and have this problem. I have tried replacing the global.js in the theme with the Buddypress file as I read elsewhere, but this didn’t work.
I also tried adding the code above into functions.php, but again, no luck.
Any other ideas?
Thanks
@applegateian the code i posted isn’t just to add to functions.php, the point is to find where the existing ajax.php and global.js files are being included and wrap those lines in
if ( !is_admin() ) { //existing code to wrap in this check goes here. }i think in a child theme you’ll have to do it in the parent theme since functions.php of the child and parent both get loaded. hope this helps!
Thanks Tmuka
In the parent theme, there are two instances in functions.php where if ( !is_admin()…. appears as below:
function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) { if ( !is_admin() || !is_super_admin() ) return false; if ( 'activity' == $_POST['page_on_front'] ) return 'activity'; else return $oldvalue; }if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) add_action( 'admin_notices', 'bp_dtheme_show_notice' );I’m not entirely clear where to add the code above, any thoughts?
The child theme functions.php is empty.
Thanks,
Ian
yes, you need to find the part inside of the if statement in my original post, not the if is_admin wrapper that you need to add…
The topic ‘Admin jQuery error on install "Uncaught TypeError: Object #…"’ is closed to new replies.