Support Forum

Cannot upload images

OD Olivier Duong
Olivier Duong
Member

Hi,

I’m an admin and I’m trying to upload some images with the upload plugin but can’t.

It shows the file and file size but when I hit start upload it just doesn’t go! Can anyone help?

19 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

You most probably have a JavaScript conflict – your wp theme or another plugin – which needs to be fixed. This codex article explains the most common conflict we come across, what this means and what to look for:

http://codex.simple-press.com/codex/faq/troubleshooting/what-is-this-jquery-conflict/

OD Olivier Duong
Olivier Duong
Member

Is there any alternative dumber uploader? A photography forum without upload is really troublesome…

Thanks and take care

YS Yellow Swordfish
Yellow Swordfish
Member

I can see – how that would be a nuisance!

Why don’t we find out what the problem is and fix it? Isn’t that the best all-round solution? Why don’t you give me a link to your site in case I can spot the issue?

OD Olivier Duong
Olivier Duong
Member

http://www.theinspiredeye.net/photography-forum/

Thanks so much! I don’t understand what the Pagelines folks said here:

http://www.pagelines.com/forum/topic/26242-simple-press-conflict/

YS Yellow Swordfish
Yellow Swordfish
Member

Curious. Basically they seem to be suggesting that the conflict is caused by some script they are loading called ‘bootstrap’ and the code fragment they pasted there is a way to deal with it. So I suggest we give it a try…

I would…. go to the forum admin > themes > theme editor and load the spFunctions.php file into the editor.

At the end of this short file you will see what is called a closing php tag – a question mark and right angle bracket. Put the cursor a line or two above that and paste the following code in.

add_action( 'wp_enqueue_scripts', 'deregister_pl_bootstrap' );
 
function deregister_pl_bootstrap() {
    if(sp_is_forumpage()) {
        wp_deregister_script('pagelines-bootstrap-all');
    }
}

IMPORTANT: There Must be NO empty lines AFTER that closing php tag at the bottom.

Save this and see what happens when you run the forum…. If it works then we will need to do a little work. if it doesnlt then we need to look again. Be sure to empty your browser cache before you test this in the forum.

YS Yellow Swordfish
Yellow Swordfish
Member

Which part didn’t work? Was the Pagelines ‘bootstrap’ script still getting loaded anyway?

OK – loaded your forum page and yes – it IS still getting loaded. Let me check that call…

Well – the code works for me. At least – let’s say that the code WILL identify the page as a forum page at that spot and will run the action hook. SO maybe the name of the script ‘pagelines-bootstrap-all’ is wrong. I would need to see the original theme code file to discover that.

OD Olivier Duong
Olivier Duong
Member

Happy Easter!

What file would you need exactly? Please PM me your email so I can send it. Thanks so much for the help, extremely grateful!

YS Yellow Swordfish
Yellow Swordfish
Member

I have absolutely no idea. While there are some basic common practices and a few ground rules amongst developers of WP themes, many just ignore them and do their own thing. Bad or irresponsible theme is probably our number 1 issue.

As it happens I am working with another theme at the moment for a personal site that includes bootstrap and intend to load SP into the site this morning so let me try that and see if I can detect both is and why bootstrap may be an issue. I will come back on this…

YS Yellow Swordfish
Yellow Swordfish
Member

Can we try a few things…

First – go to the forum admin > Integration > Page and Permalink panel. And turn ON the option to load Javascript in the footer. Empty the browser cache. Reload a topic to add a post and try the uploader…

OD Olivier Duong
Olivier Duong
Member

Nopes, not working. Do I remove the code you gave me previously?

YS Yellow Swordfish
Yellow Swordfish
Member

Shame. After research and trials I can see that if the uploader script and styling is loaded after the bootstrap code then things should work OK. The problem is with the bootstrap module. It overrides styling and code set up by the use of the jQuery UI components and WordPress supports the jQuery UI natively but not bootstrap.

You may as well leave that code in place as we need to get it working. What we need is to check that the tag for bootstrap that was in that forum post and that we used in the code is, actually correct. The theory is good and I have tested it here on my development sites.

So – do you know how to look through the code files of the theme to find things?

YS Yellow Swordfish
Yellow Swordfish
Member

Excellent. So you are looking for a line of code that uses the function wp_register_script() and another that uses the function wp_enqueue_script() and in both cases this will be using some passing some sort of tag name to represent the bootstrap library – so it will have the name of ‘bootstrap’ in there. We need to see those 2 lines of code…