Your software
My Mautic version is: 5.0.3
My PHP version is: 8.0.30
My Database type and version is: MySQL 8.0.33
Your problem
My problem is:
Yesterday I upgraded from Mautic 4.4.10 to 5.0.3 in a test environment and seem to be experiencing issues with characters being escaped in unusual places. I touched on it in an earlier post (Mautic 5.0.3 Sparkpost plugin issues) which wasn’t directly related, so I thought it deserved its own post.
I first noticed the issue on all of the “Save & Close” buttons, appearing as “Save & Close” which is a minor issue.
It becomes more problematic as it appears to be effecting certain configuration values, in particular I’ve noticed the values in custom email headers being encoded…
Is anybody else experiencing this?
These errors are showing in the log:
none
Steps I have tried to fix the problem:
Checked default_charset = “UTF-8” in php.ini (which it already was)
I was able to fix the first “Save & Close” button label above by modifying the messages.ini translations file at;
translations/en_GB/CoreBundle/messages.ini
Changed the line:
mautic.core.form.saveandclose="Save & Close"
to
mautic.core.form.saveandclose="Save & Close"
I am new to this so I am not sure if this is the right way to solve this.
I found a closed bug for the Save & Close button issue… Not sure why it was still a problem in my instance… perhaps something to do with the way Mautic is updated from 4.4 to 5.
Save & Close button showing & in translations
I opened a bug regarding the second issue…
JSON value custom email header values are being html encoded on save
My work around for the second issue is to comment out the mailer_custom_headers
line below in the file app/bundles/EmailBundle/Form/Type/ConfigType.php
is a quick interim fix…
$builder->addEventSubscriber(
new CleanFormSubscriber(
[
'mailer_from_email' => 'email',
'mailer_return_path' => 'email',
'default_signature_text' => 'html',
'unsubscribe_text' => 'html',
'unsubscribe_message' => 'html',
'resubscribe_message' => 'html',
'webview_text' => 'html',
// Encode special chars to keep congruent with Email entity custom headers
//'mailer_custom_headers' => 'clean',
]
)
);