Tiny MCE problem

Dear OJS Support,

Under /manager/setup OJS isn’t loading Tiny MCE, i have a ReferenceError: Can’t find variable: tinyMCE.
Can you please help me?

Best regards,
Miguel Braga

Hi @miguelbraga,

What version of OJS are you using? (Please include this in your posts.)

Watch your browser console and see if there’s either something like a permissions problem (potentially a 403 response code) or another Javascript error showing up before the one you mention. A tool like Firebug for Firebox might be helpful.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec!

I’m using 2.4.4.1. The errors i’m seeing are (copy pasted firebug):

[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (tiny_mce_gzip.php, line 0)
[Error] SyntaxError: Unexpected token ‘<’
appendChild (3:1:86)
eval (tiny_mce_gzip.js:134:86)
loadScripts (tiny_mce_gzip.js:80)
init (tiny_mce_gzip.js:32)
Código global (3:69)
[Error] ReferenceError: Can’t find variable: tinyMCE
Código global (3:78)
[Error] TypeError: $(’#component-grid-filter-parserfiltergrid-58c6c8f9226c4’).pkpHandler is not a function. (In ‘$(’#component-grid-filter-parserfiltergrid-58c6c8f9226c4’).pkpHandler’, ‘$(’#component-grid-filter-parserfiltergrid-58c6c8f9226c4’).pkpHandler’ is undefined)
(função anónima) (Elemento de script 2:3)
ready (jquery.min.js:282)
init (jquery.min.js:199)
jQuery (jquery.min.js:25)
Código global (Elemento de script 2:2)
insertBefore
globalEval (jquery.min.js:608)
evalScript (jquery.min.js:5224)
each (jquery.min.js:648)
domManip (jquery.min.js:4980)
append (jquery.min.js:4735)
html (jquery.min.js:4883)
(função anónima) (3:663)
handleSuccess (jquery.min.js:6170)
onreadystatechange (jquery.min.js:6004)
[Error] TypeError: $(’#component-grid-filter-lookupfiltergrid-58c6c8f9a293e’).pkpHandler is not a function. (In ‘$(’#component-grid-filter-lookupfiltergrid-58c6c8f9a293e’).pkpHandler’, ‘$(’#component-grid-filter-lookupfiltergrid-58c6c8f9a293e’).pkpHandler’ is undefined)
(função anónima) (Elemento de script 1:3)
ready (jquery.min.js:282)
init (jquery.min.js:199)
jQuery (jquery.min.js:25)
Código global (Elemento de script 1:2)
insertBefore
globalEval (jquery.min.js:608)
evalScript (jquery.min.js:5224)
each (jquery.min.js:648)
domManip (jquery.min.js:4980)
append (jquery.min.js:4735)
html (jquery.min.js:4883)
(função anónima) (3:686)
handleSuccess (jquery.min.js:6170)
onreadystatechange (jquery.min.js:6004)

Many thanks,
Miguel

Hi @miguelbraga,

Yep, that 403 is the problem, I think. Make sure your file permissions are set such that the server is allowed to serve up lib/pkp/lib/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php in your installation.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

Many thanks for pointing me in the right direction! In the case that someone might bump into the same problem, I had a rule in my .htaccess that was blocking the execution of tiny_mce_gzip.php; i just removed this and Tiny MCE is up and running:

Disallow access to rogue PHP files throughout the site, unless they are explicitly allowed
RewriteCond %{REQUEST_FILENAME} .php$
RewriteCond %{REQUEST_FILENAME} !/index[23]?.php$
The next line is to explicitly allow the forum post assistant(fpa-xx)script to run
RewriteCond %{REQUEST_FILENAME} !/fpa-[a-z]{2}.php
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^([^/]+/)*([^/.]+.)+php$ - [F]

My idea was to protect OJS from rogue php files, in case that someone would manage to “inject” a file.
I know… i’m not a “programmer”, i’m more of a “curious designer” and my “logic” is of course wrong.

Thanks again for your help!!!
Best regards,
Miguel Braga

Hi @miguelbraga,

Glad you got it working! Thanks for following up with the details.

Regards,
Alec Smecher
Public Knowledge Project Team