OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Javascript Links in OJS

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Javascript Links in OJS

Postby byteKultur » Wed Jan 23, 2013 6:10 am

Hi all,

I have OJS installed and set up for a conference.
Logged in as an editor, I should be able to see reviewed abstracts including the choice made by the reviewer in a "Review form responce".
There is a symbol which should open a popup with the result, but the function to open it (from general.js) is not found.

I found out that the link of fontControl.js and general.js are not in the right place: they are embedded in the head from
/ojs/lib/pkp/js/functions

But the actual files are placed in
/ojs/lib/pkp/js

I could solve the problem by creating a function folder and copying the js files into it, but maybe you'd like to consider...
Best regards,
Terry
byteKultur
 
Posts: 2
Joined: Mon Aug 13, 2012 2:13 am

Re: Javascript Links in OJS

Postby asmecher » Wed Jan 23, 2013 9:43 am

Hi Terry,

Are you sure this was an unmodified installation? What version was it? (And you mentioned conferences -- are you using OJS or OCS?)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7681
Joined: Wed Aug 10, 2005 12:56 pm

Re: Javascript Links in OJS

Postby keir » Mon Jul 29, 2013 8:46 pm

I have the same problem.
Having installed ojs 2.4.2 I find that the logs turn up many errors similar to

[error] [client 129.78.72.154] File does not exist: /var/www/journals/lib/pkp/js/fontController.js, referer: http://ojs-dev/index.php/tesj/manager/reviewForms

The installation was a full install copy of user files and then rebuilding the old database.

The missing files are is located in the /var/www/journals/lib/pkp/js/functions
directory. As you can imagine some functionality is lost.

I tried searching the ojs directories to find references to these directories but so far no success.

Does anyone know how we can alter where ojs looks for these files?
keir
 
Posts: 14
Joined: Sun Aug 12, 2012 9:43 pm

Re: Javascript Links in OJS

Postby asmecher » Tue Jul 30, 2013 9:21 am

Hi keir,

Most headers in the system are generated in the lib/pkp/templates/common/header.tpl file. This includes:
Code: Select all
{include file="common/minifiedScripts.tpl"}
In turn, this file (templates/common/minifiedScripts.tpl) ought to include the following line:
Code: Select all
<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/functions/fontController.js"></script>
This looks to me to point to the right location. Is your code different?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7681
Joined: Wed Aug 10, 2005 12:56 pm

Re: Javascript Links in OJS

Postby keir » Tue Jul 30, 2013 5:37 pm

All the references in minifiedScripts.tpl are correct
The error log show OJS is trying to find some files in the wrong directories for example
/var/www/journals/lib/pkp/js/fontController.js which should be
/var/www/journals/lib/pkp/js/functions/fontController.js

All the templates have the correct directories in them however the directory
cache/t_compile contains incorrect references. i tried deleting the contents of the t_compile directory but the incorrect references later regenerated.

I added symbolic links to the js directory linking to files in the functions directory and errors for those files went away. Hhowever there are errors for files in other directories. I would prefer to find a correct fix.

Does anyone have any suggestions of what might be wrong or what to look for?
keir
 
Posts: 14
Joined: Sun Aug 12, 2012 9:43 pm

Re: Javascript Links in OJS

Postby asmecher » Wed Jul 31, 2013 10:27 am

Hi keir,

The cache/t_compile files are generated from the .tpl files, so if everything is correct in the .tpl files, I'm not sure how the cache can be generated incorrectly. Do you have a public URL you can share? Is it possible that some older code still remains in your 2.4.x installation? Are the incorrect files referenced in all requests, or just certain ones?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7681
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests