Open loadbrain opened 10 months ago
I tested this now with OJS 3.4.0-1 and 3.4.0-2, same problem...
This one:
[Thu Nov 09 10:30:15.263226 2023] [php:warn] [pid 109053] [client 193.197.86.24:51633] PHP Warning: You are sending Einreichung ben\xc3\xb6tigt Redakteur/in in /var/www/ojs.nomos-journals.de/lib/pkp/classes/mail/Mailable.php on line 363, referer: http://ojsdev.nomos-journals.de/index.php/mt/submission?id=26
looks really like en encoding thing to me.
Should be "Einreichung benötigt Redakteur"
Added french language, switched to french, same error
Got error 'PHP message: PHP Warning: You are sending ##mailable.submissionNeedsEditor.name## in /var/www/clients/client50/web168/web/ojs3/lib/pkp/classes/mail/Mailable.php on line 363; PHP message: Slim Application Error:\nType: TypeError\nMessage: get_class(): Argument #1 ($object) must be of type object, null given\nFile: /var/www/clients/client50/web168/web/ojs3/lib/pkp/classes/mail/Mailer.php\nLine: 79
I find the solution. When installing OJS you MUST choose english as language. You can add other languages. Then everything works fine afterwards.
This issue is related to https://github.com/pkp/pkp-lib/issues/9444
The problem is in the Laravel's Mailer::render()
:
public function render($view, array $data = [])
{
[$view, $plain, $raw] = $this->parseView($view); // if email's body is empty, these values are returned: ['', null, null]
$data['message'] = $this->createMessage();
return $this->renderView($view ?: $plain, $data); // null is passed as a first argument to the `renderView` method
}
We override Mailer::renderView(): https://github.com/pkp/pkp-lib/blob/main/classes/mail/Mailer.php#L71
I can reproduce this problem only in the case when mailable's body is logged: https://github.com/pkp/pkp-lib/blob/0140623fc6960f0d8572837f1b6f7d71c0d52372/classes/log/SubmissionEmailLogDAO.php#L89
@jonasraoni, can you take a look at this one?
@jonasraoni @Vitaliy-1 Hi guys. I have the same issue with a fresh new installed OJS 3.4.0-4 version where Italian language is used. On the final step for sending the submission the confirmation pop-up windows stocks there and never finish the sending
If I close the pop-up by clicking on the exit button, the submission has been saved but the emails to author and Journal Editors has not been sent.
If I change the journal's language to English everything's ok.
@loadbrain : your suggestion of installing OJS in English and add new language later didn't work for me.
To reproduce the behaviour
System Information
Version history
Version Major Minor Revision Build Date installed 3.4.0.4 3 4 0 4 2024-01-18
Server Information
Setting Name Setting Value OS platform Linux PHP version 8.1.17 Apache version Apache/2.4.6 (CentOS) PHP/8.1.17 Database driver mysql Database server version 10.6.13-MariaDB-log
ERROR LOG
[18-Jan-2024 14:43:58 Europe/Rome] PHP Warning: You are sending ##mailable.submissionNeedsEditor.name## in /var/www/vhosts/ojs3-4-0-test-rino.archicoop.local/lib/pkp/classes/m ail/Mailable.php on line 365 [18-Jan-2024 14:43:58 Europe/Rome] Connection to "process /usr/sbin/sendmail -bs" has been closed unexpectedly. [18-Jan-2024 14:43:58 Europe/Rome] Slim Application Error: Type: TypeError Message: get_class(): Argument #1 ($object) must be of type object, null given File: /var/www/vhosts/ojs3-4-0-test-rino.archicoop.local/lib/pkp/classes/mail/Mailer.php Line: 79 Trace: #0 /var/www/vhosts/ojs3-4-0-test-rino.archicoop.local/lib/pkp/classes/mail/Mailer.php(79): get_class()
te\Mail{closure}()
dle()
vents{closure}()
View in rendered output by enabling the "displayErrorDetails" setting.
Updates on my previous post: I've been able to solve the issue by editing the DB table "email_templates_default_data" and putting content in the empty fields "subject", "name" and "body" whose "locale" field had "it" (Italian) value.
Yes, that is really a mess... In german too, there were a lot of empty subject and body fields in this table. Was a lot of work to fill all...🙄
This issue is related to #9444
The problem is in the Laravel's
Mailer::render()
:public function render($view, array $data = []) { [$view, $plain, $raw] = $this->parseView($view); // if email's body is empty, these values are returned: ['', null, null] $data['message'] = $this->createMessage(); return $this->renderView($view ?: $plain, $data); // null is passed as a first argument to the `renderView` method }
We override Mailer::renderView(): https://github.com/pkp/pkp-lib/blob/main/classes/mail/Mailer.php#L71
I can reproduce this problem only in the case when mailable's body is logged:
@jonasraoni, can you take a look at this one?
Could you share your change?
Describe the bug When submitting a new submission an empty E-Mail is sent, page freezes. An empty E-Mail is sent., but the submission is succesfull.
This does not happen when choosing english as language, but with german. I also tested it then with french, same problem.
Maybe encoding problem?
Error Log: `
[Thu Nov 09 10:30:15.263226 2023] [php:warn] [pid 109053] [client 193.197.86.24:51633] PHP Warning: You are sending Einreichung ben\xc3\xb6tigt Redakteur/in in /var/www/ojs.nomos-journals.de/lib/pkp/classes/mail/Mailable.php on line 363, referer: http://ojsdev.nomos-journals.de/index.php/mt/submission?id=26
[Thu Nov 09 10:30:16.688805 2023] [php:notice] [pid 109053] [client 193.197.86.24:51633] Slim Application Error:\nType: TypeError\nMessage: get_class(): Argument #1 ($object) must be of type object, null given\nFile: /var/www/ojs.nomos-journals.de/lib/pkp/classes/mail/Mailer.php\nLine: 79\nTrace: #0 /var/www/ojs.nomos-journals.de/lib/pkp/classes/mail/Mailer.php(79): get_class()\n#1 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(239): PKP\mail\Mailer->renderView()\n#2 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(281): Illuminate\Mail\Mailer->render()\n#3 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\Mail\Mailable->Illuminate\Mail\{closure}()\n#4 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(278): Illuminate\Mail\Mailable->withLocale()\n#5 /var/www/ojs.nomos-journals.de/lib/pkp/classes/log/SubmissionEmailLogDAO.php(89): Illuminate\Mail\Mailable->render()\n#6 /var/www/ojs.nomos-journals.de/lib/pkp/classes/observers/listeners/AssignEditors.php(121): PKP\log\SubmissionEmailLogDAO->logMailable()\n#7 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(441): PKP\observers\listeners\AssignEditors->handle()\n#8 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()\n#9 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(451): Illuminate\Events\Dispatcher->dispatch()\n#10 /var/www/ojs.nomos-journals.de/lib/pkp/classes/submission/Repository.php(593): event()\n#11 /var/www/ojs.nomos-journals.de/lib/pkp/api/v1/submissions/PKPSubmissionHandler.php(717): PKP\submission\Repository->submit()\n#12 [internal function]: PKP\API\v1\submissions\PKPSubmissionHandler->submit()\n#13 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func()\n#14 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->invoke()\n#15 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->invoke()\n#16 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack()\n#17 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run()\n#18 /var/www/ojs.nomos-journals.de/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.php(90): Slim\App->invoke()\n#19 [internal function]: PKP\security\authorization\internal\ApiAuthorizationMiddleware->invoke()\n#20 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#21 [internal function]: Slim\DeferredCallable->invoke()\n#22 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#23 /var/www/ojs.nomos-journals.de/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.php(56): Slim\App->Slim\{closure}()\n#24 [internal function]: PKP\security\authorization\internal\ApiCsrfMiddleware->invoke()\n#25 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#26 [internal function]: Slim\DeferredCallable->invoke()\n#27 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#28 /var/www/ojs.nomos-journals.de/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.php(140): Slim\App->Slim\{closure}()\n#29 [internal function]: PKP\security\authorization\internal\ApiTokenDecodingMiddleware->invoke()\n#30 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#31 [internal function]: Slim\DeferredCallable->invoke()\n#32 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#33 /var/www/ojs.nomos-journals.de/lib/pkp/classes/handler/APIHandler.php(83): Slim\App->Slim\{closure}()\n#34 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}()\n#35 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#36 [internal function]: Slim\DeferredCallable->__invoke()\n#37 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#38 /var/www/ojs.nomos-journals.de/lib/pkp/classes/handler/APIHandler.php(100): Slim\App->Slim\{closure}()\n#39 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}()\n#40 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#41 [internal function]: Slim\DeferredCallable->invoke()\n#42 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#43 /var/www/ojs.nomos-journals.de/lib/pkp/classes/handler/APIHandler.php(105): Slim\App->Slim\{closure}()\n#44 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}()\n#45 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#46 [internal function]: Slim\DeferredCallable->invoke()\n#47 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#48 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}()\n#49 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack()\n#50 /var/www/ojs.nomos-journals.de/lib/pkp/classes/handler/APIHandler.php(98): Slim\App->process()\n#51 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}()\n#52 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#53 [internal function]: Slim\DeferredCallable->__invoke()\n#54 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#55 /var/www/ojs.nomos-journals.de/lib/pkp/classes/handler/APIHandler.php(105): Slim\App->Slim\{closure}()\n#56 [internal function]: PKP\handler\APIHandler->PKP\handler\{closure}()\n#57 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()\n#58 [internal function]: Slim\DeferredCallable->invoke()\n#59 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()\n#60 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}()\n#61 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack()\n#62 /var/www/ojs.nomos-journals.de/lib/pkp/lib/vendor/slim/slim/Slim/App.php(297): Slim\App->process()\n#63 /var/www/ojs.nomos-journals.de/lib/pkp/classes/core/APIRouter.php(110): Slim\App->run()\n#64 /var/www/ojs.nomos-journals.de/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\APIRouter->route()\n#65 /var/www/ojs.nomos-journals.de/lib/pkp/classes/core/PKPApplication.php(387): PKP\core\Dispatcher->dispatch()\n#66 /var/www/ojs.nomos-journals.de/index.php(21): PKP\core\PKPApplication->execute()\n#67 {main}\nView in rendered output by enabling the "displayErrorDetails" setting.\n, referer: http://ojsdev.nomos-journals.de/index.php/mt/submission?id=26
`
To Reproduce Steps to reproduce the behavior:
What application are you using? OJS, 3.4.0.3
Additional information![3d97b1493b37244cc25201a523cf2d18048d1d93](https://github.com/pkp/pkp-lib/assets/5653662/4be45d2f-4b37-47b3-acc7-3d51dd44b7df)