Error when submitting an article

Hi @carvalhoek,

I’m not sure I can give much guidance, since your set-up will be pretty specific – but the URLs to those JS files are built in lib/pkp/js/controllers/SiteHandler.js (which is compiled into the minified Javascript for OJS – js/pkp.min.js – if you have minification enabled). I see a similarly-built URL in lib/pkp/js/controllers/UploaderHandler.js for lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.swf and lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.xap so I suspect the file uploader may also suffer similar issues.

Because the URLs are built on the client side, not the server side, mod_substitute never gets the chance to work on them. One thing you could do without much work is move the URL construction into the server side, i.e. into Smarty templates where the Javascript gets bound to the markup, so that the full URLs to the problem files are provided as parameters to the Javascript handler. If you’re willing to work on a pull request to make that change, we could merge it into a future release and you wouldn’t need to worry about preserving the modification.

For the TinyMCE example, it would mean editing lib/pkp/templates/common/header.tpl to add the new parameter to SiteHandler. Then call on that new parameter in SiteHandler.js instead of building the URL in Javascript.

This should get your mod_substitute rules to apply to those TinyMCE plugins. Just don’t forget to recompile the JS if you’re using minification, or disable minification to work with the individual .js files directly.

Regards,
Alec Smecher
Public Knowledge Project Team