• 0

[resolved] Simple:Press bootstrap uploader issue


Question

Posted · Report post

I'm using the Simple:Press forum plugin and the forum has its own plugins, and one that is not running properly is the file uploader. Simple:Press says it's due to a conflict with bootstrap, and they suggest that I edit the theme and make sure bootstrap is loaded before the jQuery-UI core library.

 

My website: http://www.weaversguildmn.org. The page is this: http://www.weaversguildmn.org/forum The theme is pagelines framework running on wordpress 3.8.

 

I'm a beginner. Can someone explain step by step, how to edit the page's theme so that bootstrap loads before the jquery-ui..?

 

1 person likes this

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted · Report post

Hi,

 

I have brought this to the attention of one of our developers. However, I don't believe your issue could be caused by what they suggested.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I have the same issue to, the file uploader don't upload files. When i put back twenty fourteen il place of DMS, the upload works. 

Do you found a solution or something? 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Could you create a new topic for this with the listed requirements from the message when you create a new topic. Thanks. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

tried this solution, not working...

And the solution is for pagelines framework, not for dms2.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

The script handlers are the same.

 

add_action('wp_print_scripts', 'deregister_pl_bootstrap', 100);
function deregister_pl_bootstrap() {
    if(sp_is_forumpage()) {
        wp_dequeue_script('pagelines-bootstrap-all');
    }
}
 
Anyway that works as long as sp_is_forumpage() is still part of simplepress forum. No way I could check as all their support forum posts are behind a paywall.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Ok here's what I had to do to get it to work in DMS 2...

 

Since the uploader plugin is conflicting with bootstrap, you need to dequeue all bootstrap files on that page (also as posted above) 

 

add_action('wp_print_scripts', 'deregister_pl_bootstrap', 100);

 

function deregister_pl_bootstrap() {
   if(sp_is_forumpage()) {
   wp_dequeue_script( 'pagelines-bootstrap-all' );
   }
}
 
Now, this will only work when the DMS editor is disabled. The DMS Editor loads pagelines-bootstrap-all on its own, so if the editor is enabled, the above function won't work. (this isn't a problem for guests on your site, since they can't access the DMS editor anyway)
 
So when the DMS editor is disabled, I noticed that two new issues came up. The dropdown menu in my navi section no longer works. This makes sense because the drop down menu uses bootstrap script which we I just disabled. The other issue I ran into, was that now my "Add Topic" and "Add Reply" button no longer worked. Inspecting in Chrome, you'll see the following error:
 
Uncaught TypeError: undefined is not a function      pl.common.js
 
You can fix both issues (navi dropdown and add topic/reply button don't work) by enqueueing the bootstrap-dropdown.js script. I understand why this fixes the navi dropdown issue, but don't know why it fixes the add topic/reply button issue, but hey I'm not complaining.
 
Anyway, go to https://raw.githubusercontent.com/twbs/bootstrap/v2.2.2/js/bootstrap-dropdown.js and copy the script and save it to a file on your computer, naming it bootstrap-dropdown.js
 
Note: you can't use the raw.githubusercontent.com as the script source, cause it won't work. You need to have the file on your server. 
 
I placed the file directly in my child theme. You may have a better place to put it, but here's the code I used to enqueue it:
 
add_action('wp_enqueue_scripts', 'enqueue_dropdown_script', 100);
 
function enqueue_dropdown_script() {
if(sp_is_forumpage()) {
$scriptsrc = get_stylesheet_directory_uri(); 
wp_register_script( 'bootstrap-dropdown', $scriptsrc . '/bootstrap-dropdown.js', array( 'jquery' ) );
  wp_enqueue_script( 'bootstrap-dropdown' );
}
}
 
Hope this helps someone. Props to simon for helping me figure this out.
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now