word Press Nano Mag problem: cannot upload any media

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

Hi

This morning we have had a big headache. We cleared the files and database of a site we run, in favour of using Word Press and the "nano mag" theme from theme-forest. It's a theme we have used before, successfully.

So we uploaded Word Press latest files and got it all up and running.
Then we uploaded an image
Then we installed the Nano Mag theme. And now, the button to "Add New" in the media page is dead. Doesn't do anything.
In Theme Options, where you click 'Upload' to browse for a logo, that button is dead too.

Could it be some tweak we need to make somewhere? I doubt it's down to the server, which is FastCGI.

Please help.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: word Press Nano Mag problem: cannot upload any media

Post by Celauran »

This being a non-free theme that none of us can look at is definitely going to complicate things here. Have you confirmed it's specific to this theme by installing another theme and seeing the problem disappear? What do you mean by the button is 'dead'? Is it disabled? Have you checked the console for JavaScript errors?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

It's definitely the nano mag theme that kills the Media Library page.
If I deactive the theme and delete it completely, and use one of the default themes, the media library shows up fine, wtih Add/drag.
So what could be causing it in that theme?

I have downloaded the theme again, but still it causes the same problem.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: word Press Nano Mag problem: cannot upload any media

Post by Celauran »

Celauran wrote:Have you checked the console for JavaScript errors?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

Yes I understand the issue you might face.
The Blue button in that page is enabled, so it shows it's being clicked, but does nothing.
The Media Library page that normally shows the big box to select or drag into, disappears. Literally nothing shows on that page except the title and the blue button.
If I use a default theme, it's fine.

I am happy to send you the theme files if it helps. Not sure how I would do that though via here. But would say it is the same theme files we used for the other two web sites. In fact I used this very set of files for a current site.
Have you checked the console for JavaScript errors?
No, but then I'm not sure how to read that. Since it is not my code, and it wrks elsewhere, it could cause me more issues!
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: word Press Nano Mag problem: cannot upload any media

Post by Celauran »

Checking for JS errors in the console (right click, Inspect Element, switch to console tab, reload page) will not introduce any other problems. You're just looking. Media picker opens in a modal and now isn't opening, so that's where I'd start. Being WordPress, there's also the possibility of a conflict of some sort between this and some plugin or other. Have you disabled any plugins to rule out that possibility?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

Here is the error console.
I have installed it again, and yet again the MEdia Library is dead.
The ADd New is grey, ad goes blue on hover, but nothing is on the page.

It's as though there is something in those Theme files that is disabling it all.
Error Console
Error Console
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

All I now have is Contact Form 7, but that is inactive.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: word Press Nano Mag problem: cannot upload any media

Post by Celauran »

wp.Uploader is undefined
There's your problem.

One solution I've seen is to add

Code: Select all

define('CONCATENATE_SCRIPTS', false );
into your wp-config.php right before

Code: Select all

require_once(ABSPATH . 'wp-settings.php');
If that doesn't resolve it, we'll dig further.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

Ahh you genius.
What the hell was that then? It's done it. Can you tell me what that line was... or perhaps what it's "fixing" from the install.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: word Press Nano Mag problem: cannot upload any media

Post by Celauran »

Haven't really gone down that rabbit hole. Seen the solution provided many times in a number of places, but it's always because reasons. That particular constant is only referenced in wp-includes/script-loader.php if you're curious, but chasing that code is probably a good way to burn a bunch of hours.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: word Press Nano Mag problem: cannot upload any media

Post by simonmlewis »

Yeah.
It's one of those oddities I suppose. Why it didn't occur on other sites but has here.
But now I know, I'll remember it for next time. Thanks again.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply