OJS 3.0.2 pkp.min.js loading before jquery

The minified scripts (pkp.min.js) load before jquery, causing the browser to throw a “TypeError: a is not a function” error.

Hi @Steve_Michaels,

Is your site live? If so, can you provide me with its URL?

Regards,
Alec Smecher
Public Knowledge Project Team

I get the same problem with my theme and the default.

Steve Michaels
Emerging Technologies Librarian

ph 616.392.8555 x187
101 East 13th Street, Holland MI 49423-3622
[image: WTS_logo_email.png]

Hi @Steve_Michaels,

Have you made any modifications to your installation? If I recall correctly,neither the pkp.min.js scripts nor JQuery are supposed to be loaded in the reader front-end – only the administrative back-end.

Regards,
Alec Smecher
Public Knowledge Project Team

I think that jquery does load in the frontend by default. Just today I added a tooltip function to the embedGalley plugin using jqueryui. That is also loaded by default.

I haven’t change anything from base code.

STEVE Michaels

Emerging Technologies Librarian

ph 616.392.8555 x187

101 East 13th Street, Holland MI 49423-3622

[image: WTS_logo_email.png]

Hi all,

Tagging @NateWr, who would be the best person to answer – but just a heads-up that he may be away for a few days.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @Steve_Michaels,

Can you post the code for your theme here? I can see a lot of things that are’t part of any of our provided themes or the core application. For instance, you’re loading lots of assets from the Foundation framework which isn’t in use in anything I’m aware of. The pkp.min.js file shouldn’t ever be loaded on the frontend.

The code’s available at GitHub - michaelsse/WTS-OJS-Theme: Western Theological Seminary OJS3 Bootstrap 3 Theme. Most of the Foundation stuff is being used by institutional branding/theme rather than OJS directly.

I get the behavior regardless of which theme I use (mine, the default, your bootstrap3), but only if I have enable_minified = on.

Thanks @Steve_Michaels! This helped me track down a bug with this file being loaded on the frontend when enable_minify is on. This only emerged recently due to related fix with that config setting.

You can see the fix if you want to apply it in your own installation before the next release:

https://github.com/pkp/pkp-lib/commit/3a6bb908269ead65274a4e79015552fd1725bd39

2 Likes

Definitely took care of that problem. Glad I could help.