Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Bug? Firebug shows SimplePress admin is trying to call "sp-admin-events.js" which doesn't exist
Avatar
Helping Outreach
Member
Free Members
sp_UserOfflineSmall Offline
Oct 3, 2016 - 9:46 am

Whenever I visit a page in Simple:Press Admin, I see in the Firebug "Net" panel that it's trying to call the following:

example.com/wp-content/plugins/simple-press/admin/resources/jscript/sp-admin-events.js?ver=b49226455124b19b22e633771dbb7f1f

Resulting in a 404 error. I have WP 4.6.1 and SimplePress Version: 5.7.1 Build: 14502. (I also still have "Enable combining and caching of forum script (JS) files" unchecked from when I was doing development work.)

I found that in the following file:

\wp-content\plugins\simple-press\sp-startup\admin\spa-admin-framework.php

It makes the following call:

$script = (defined('SP_SCRIPTS_DEBUG') && SP_SCRIPTS_DEBUG) ? SFAJSCRIPT.'spa-admin-events-dev.js' : SFAJSCRIPT.'sp-admin-events.js';

So here is where it's being called, clearly. But 1) the "sp-admin-events.js" file doesn't exist anywhere, and 2) I'm not aware of any debug mode.

Why is it calling a file that doesn't exist by default, and only calling the file that does exist ("spa-admin-events.js") when it's in some debug mode? Is this a bug? Thank you!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 3, 2016 - 11:25 am

Oh wow. That's a clear and plain typo and I can't explain why we have not heard of this before now. Look at the code. The file is named 'spa-admin-events-dev.js' but that else clause calls is 'sp-' not 'spa-' as it should be.

That's bad.

As explanation - the main file is minimised and compressed and the debug version is not. You can define a constant of SFAJSCRIPT set to true to run the uncompressed versions of the files. Good for debugging and testing. WordPress allows for similar constants to be defined.

For now I would advise you to edit the name of the errant file - or edit the code where it is loaded. And we will clean up the bug quickly. We are planning a release fairly imminently as it happens.

And apologies for the typo.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620