Author Topic: powerpressadmin.php: Inclusion of jquery-ui-tabs breaks BlogsMU Theme Options  (Read 7833 times)

blueskies

  • Newbie
  • Posts: 3
I am using BlogsMU theme, version 1.2.2  http://premium.wpmudev.org/project/buddypress-blogsmu-theme
and Blubrry PowerPress 1.0.13

The page under Appearance->Theme Options has several links that act as tab controls for that page.
The page is loaded at: /wp-admin/themes.php?page=functions.php

When I activate PowerPress, the links are no longer functional.

I narrowed this down and discovered that the load of jquery-ui-tabs in the following script source loaded in the page is causing the break (changed the domain name):

src='http://www.mydomain.com/wp-admin/load-scripts.php?c=1&load=thickbox,jquery-ui-core,jquery-ui-tabs,hoverIntent,common,jquery-color&ver=4beafdb3af0091c4507cbfbb0669b6d4'

This appears to come from powerpressadmin.php:
function powerpress_admin_init():
 wp_enqueue_script('jquery-ui-tabs');

What could be happening to cause a conflict?

Is it possible to only load this when the URL is
wp-admin/admin.php  (and not themes.php) ?

Maybe better,  qualified by ?page=powerpress/...


Scott




angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
the call by PowerPress  wp_enqueue_script('jquery-ui-tabs'); is for the tab control in powerpress settings. If another plugin or theme is also using the jquery-ui-tabs, they need to call the  wp_enqueue_script('jquery-ui-tabs'); function. The error you are having is an indication that the plugin developer is not calling the appropriate function, but rather linking to a different version of the jquery tabs library, which will cause other problems, not just with PowerPress but possibly also problems with the other jquery logic built into WordPress.

blueskies

  • Newbie
  • Posts: 3
Hi Angelo,

wp_enqueue_script
I checked and noted that jquery-ui-tabs is only used by a handful of plugins and all are using wp_enqueue_script().

There was also a couple of references to jquery-ui-tabs in wp-includes/script-loader.php which I assume is a WP core file.

BlogsMU Theme
The BlogsMU theme that is seeing the problem with Powerpress activated does not use jquery-ui-tabs. It does use some other jquery files that it loads in a script tag including:
dropmenu.jquery.js, jquery.nivo.slider.pack.js, jquery.js, jquery-ui-personalized-1.6rc2.min.js, jquery.cookie.min.js, jquery.imgareaselect-0.3.min.js

I also see an instance of wp_enqueue_script being used in the BlogsMU Theme with  'dtheme-ajax-js'

Other plugins
The other plugins using  jquery-ui-tabs with wp_enqueue_script() are:
Easy Blogging and BulletProof Security

Neither of these plugins cause the problem with BlogsMU Theme, only PowerPress.


Is there another possibility to account for the conflict?

Thanks,

Scott





angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Have you reached out to the theme developers? You paid them for the theme, so technically they owe you a higher level of support than what we are providing you. If they find the problem is with our plugin, they would contact us appropriately with the steps we need to take to correct it.

One detail may have hit the mail on the head. It sounds like BlogsMU is including it's own version of the jQuery library, using jquery.js. It should be using the call  wp_enqueue_script('jquery'); and using the version of jQuery packaged in WordPress. (I need to see the BlogsMU source to confirm this)

You may find this gets resolved when you upgrade to WordPress 3.1, since it has the latest versions of jQuery at present. (PowerPress doesn't package it's own versions of jQuery tabs UI, it uses the one packaged with WordPress.

Also, I don't think the jquery-ui-tabs issue with BlogsMU is exclusive to PowerPress. If you do a Google search for "BlogsMU jquery UI tabs" you get some results of other plugins having similar issues.

Unfortunately, I no longer fix theme issues with PowerPress without the involvement of the theme developer first. I've done it in the past with mixed results, most tell me to take a hike, only a handful accept the code fixes. Please reach out to the developers of BlogsMU, ask them if they are interested in getting this problem fixed with PowerPress to contact me at cio [at] rawvoice.com.

blueskies

  • Newbie
  • Posts: 3
Hi Angelo,

Thanks for your help.  I just posted in the Support forum for the BlogsMU Theme.

In case anyone else is searching and runs across this thread, the related thread is here:
http://premium.wpmudev.org/forums/topic/tubepress-breaks-blogs-mu-theme-options-tabs

Scott

cliffseal

  • Newbie
  • Posts: 1
I fixed this issue by moving the
Code: [Select]
wp_enqueue_script('jquery-ui-tabs'); call on Line 52 into the next conditional statement on Line 58. So, the function now looks like:

Code: [Select]
if( isset($_GET['page']) && strstr($_GET['page'], 'powerpress' ) !== false )
{
//wp_enqueue_script('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js');
wp_enqueue_script('jquery-ui-tabs');
}

Worked for me, anyway!

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Thanks for the feedback, past versions of WordPress did not have the jquery tabs ui package included, I was not aware that the latest version now includes it. I'll look to see about adding this for WP 3.3+, and the old logic for older ersions of WordPress.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
PowerPress is using the jquery ui tabs library packaged in WordPress, I mis-read the quoted code thinking that we accidentally left a hard link to the ui control hosted by Google, which would have been bad.

Unfortunately I cannot make this change permanently in powrepress, the tab control is also used in other areas other than the powerpress settings, which his why it's included where it is.

The ultimate solution is for TubePress to use the jquery ui tabs library already packaged in WordPress, or they redesign what they are doing by setting up the version of jQuery they need using no-conflict mode to define a different namespace. Either way, TubePress needs to fix this, not something we can do in PowerPress.

You can copy/paste the last paragraph and email it to the developer, if he/she understands jQuery they will know exactly what they should do.

TubePress will need to fix this eventually, it's only a matter of time before WordPress itself also uses the tab control for various setting pages.