Message Module error for non-logged in users

If you aren't speaking german, you can ask for support or post your request here.
Antworten
manduck
Beiträge: 3
Registriert: 6. Aug 2020, 13:54

Message Module error for non-logged in users

Beitrag von manduck »

Non-logged in users who try to send an email using the email function, to the Administrator get a HTTP 500 error. The debug shows the error as:

Notice: Undefined variable: gL10n in /home/***/www/adm_program/system/classes/Email.php on line 427
Fatal error: Uncaught Error: Call to a member function get() on null in /home/***/www/adm_program/system/classes/Email.php:427 Stack trace: #0 /home/***/www/adm_program/modules/messages/messages_send.php(505): Email->setTemplateText('test', 'test', '', 'Author') #1 {main} thrown in /home/***/www/adm_program/system/classes/Email.php on line 427

I found that "$gL10n" was missing as a variable in adm_program/system/classes/Email.php which is called when non-logged in users send messages:

Before:

{
global $gValidLogin, $gCurrentOrganization, $gSettingsManager;


// load the template and set the new email body with template
try
{
$emailTemplateText = FileSystemUtils::readFile(ADMIDIO_PATH . FOLDER_DATA . '/mail_templates/' . $gSettingsManager->getString('mail_template'));
}
catch (\RuntimeException $exception)
{
$emailTemplateText = '#message#';
}

if (!$gValidLogin)
{
$senderName .= ' (' . $gL10n->get('MAI_SENDER_NOT_LOGGED_IN') . ') ';
}

I added "$gL10n" to line 412:

global $gL10n, $gValidLogin, $gCurrentOrganization, $gSettingsManager;

Non-logged in messages are now sent successfully.

Please update installation files.
Benutzeravatar
fasse
Administrator
Beiträge: 6041
Registriert: 12. Nov 2005, 16:06

Re: Message Module error for non-logged in users

Beitrag von fasse »

Thanks for the hint.

This error is fixed within version 4.0.5.
Antworten