lucasdiedrich / ojs

Open Journal Systems (OJS) is a journal management and publishing system.
GNU General Public License v3.0
19 stars 64 forks source link

Can not upload image in an email form creation #25

Closed Potomac54 closed 5 years ago

Potomac54 commented 5 years ago

Hello

@lucasdiedrich @marcbria ,

I notice a bug when we want to send an email with OJS 3.1.2, if I want to insert an image inside the email, with the "upload image" button, then the upload fails

bug_plugin_upload_image

the name of the image plugin seems to be "JustBoil.me images plugin", when the bug occurs I can see this error message in apache log :

HTTP/1.1" 500 - "http://localhost:8085/plugins/generic/tinymce/plugins/justboil.me/dialog-v4.htm" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0"

marcbria commented 5 years ago

Did you check this: https://forum.pkp.sfu.ca/t/justboil-me-image-upload-error/33738 Or that? https://github.com/pkp/pkp-lib/issues/1919

Cheers, m.

Potomac commented 5 years ago

@marcbria @lucasdiedrich

Sounds a complicated bug, when I will back to work I will try to check these 2 aspects :

1) the need of having a subfolder "site" in public folder because when the "site" subfolder doesn't exist then the plugin is unable to create a folder "site" inside "public" folder, even if the public folder has 777 chmod rights, and also even if the public folder belong to the apache/httpd user

@marcbria : you can do a test by renaming the "site" folder to "_site" inside public folder, and you will see that the bug will occur, even if you do a "chmod 777 -R /public",

it seems that the php code for this "justboil.me" plugin is faulty when it tries to create the subfolder "public/site"

2) the need of reseting sometimes a cookie or a session variable related to the plugin "justboil.me", according to some users in the bugreports

Potomac54 commented 5 years ago

@marcbria @lucasdiedrich

I did the tests, in the docker container the folder "public/site" is present and has "chmod 777", I delete the cookies, but I still have the bug,

then I activated the development mode in the file " /var/www/hmtl/plugins/generic/tinymce/plugins/justboil.me/ci/index.php", in order to have more info in the apache log,

I get new informations in the apache log, one warning, and one php fatal error, something related to file /var/www/html/classes/i18n/AppLocale.inc.php, and the getUserVar() function :


[Thu Apr 11 09:59:50.231582 2019] [php7:warn] [pid 36] [client 172.19.0.1:51652] PHP Warning:  include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.:/var/www/html/classes:/var/www/html/pages:/var/www/html/lib/pkp:/var/www/html/lib/pkp/classes:/var/www/html/lib/pkp/pages:/var/www/html/lib/pkp/lib/adodb:.:/usr/share/php7') in /var/www/html/plugins/generic/tinymce/plugins/justboil.me/ci/system/core/Exceptions.php on line 182, referer: http://localhost:8085/plugins/generic/tinymce/plugins/justboil.me/dialog-v4.htm

[Thu Apr 11 09:59:50.233620 2019] [php7:error] [pid 36] [client 172.19.0.1:51652] PHP Fatal error:  Uncaught Error: Call to a member function getUserVar() on null in /var/www/html/classes/i18n/AppLocale.inc.php:70\nStack trace:\n#0 /var/www/html/lib/pkp/classes/i18n/PKPLocale.inc.php(99): AppLocale::getLocale()\n#1 /var/www/html/lib/pkp/classes/i18n/PKPLocale.inc.php(766): PKPLocale::translate('installer.insta...', Array, NULL)\n#2 /var/www/html/plugins/generic/tinymce/plugins/justboil.me/integratePKP.php(103): __('installer.insta...')\n#3 /var/www/html/plugins/generic/tinymce/plugins/justboil.me/config.php(42): IntegratePKP->__construct()\n#4 /var/www/html/plugins/generic/tinymce/plugins/justboil.me/ci/application/config/uploader_settings.php(5): require('/var/www/html/p...')\n#5 /var/www/html/plugins/generic/tinymce/plugins/justboil.me/ci/system/core/Config.php(130): include('/var/www/html/p...')\n#6 /var/www/html/plugins/generic/tinymce/plugins/justboil.me/ci/application/controllers/uploader.php(21): CI_Config->load('uploader_settin...', true)\n#7 /var/www/html/plugins/generic/tinymce/plugins/justboil.me/ci/syste in /var/www/html/classes/i18n/AppLocale.inc.php on line 70, referer: http://localhost:8085/plugins/generic/tinymce/plugins/justboil.me/dialog-v4.htm

my OJS installation is configured with french language (fr_FR), and I installed additionnal language (en_US),

if I install OJS without docker then there is no bug, uploading image works

Potomac54 commented 5 years ago

@lucasdiedrich @marcbria

I fixed the bug, my ojs config file was not correct for these 2 settings :

after these 2 corrections all is ok now, I can upload image without problems

marcbria commented 5 years ago

Without taking a look to lucas' installation scripts, my two cents about this:

Thanks for your help @Potomac54. We are quite close to have this docker ready to be released.

lucasdiedrich commented 5 years ago

As this is not anymore related to the containers i'm closing the issue.

Thanks @marcbria @Potomac