by tshore » Wed Nov 28, 2012 1:23 pm
This happens when you try to use the WYSIWYG editor (TinyMCE) to add an image to your site. The plugin that TinyMCE is using is called JBImages. This is a bug - at least in the version of the code that I'm using (OCS 2.3.5). I've seen it reported a few other times, but, because it couldn't be reproduced, no one ever followed up on it.
In this file:
lib/pkp/lib/tinymce/jscripts/tiny_mce/plugins/jbimages/ci/application/controllers/editor.php
on line 174, replace this:
if ($maxUploadDirSize)
with this:
if ($uploadDirSizeExceeded)
Once I fixed the bug, I was thrilled to find out that I still could not upload an image using TinyMCE. The new error was:
The filetype you are attempting to upload is not allowed
This error is thrown by:
lib/pkp/lib/tinymce/jscripts/tiny_mce/plugins/jbimages/ci/system/libraries/Upload.php
in the function is_allowed_filetype().
It was failing the mime type check, and after a bit of debugging, it seemed that continuing would be too much trouble ($this->file_type was messed up, I think), so I just bailed and switched line 584 from:
public function is_allowed_filetype($ignore_mime = FALSE)
to:
public function is_allowed_filetype($ignore_mime = TRUE)